kltn20133118 commited on
Commit
f28c874
·
verified ·
1 Parent(s): 126d81e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,30 +1,32 @@
1
- # Sử dụng Python 3.11 làm base image
2
- FROM python:3.11
3
 
4
- # Đặt thư mục làm việc là /code
5
  WORKDIR /code
6
 
7
- # Cập nhật package list và cài đặt các thư viện cần thiết
8
  RUN apt-get update && apt-get install -y \
9
  ffmpeg \
10
  libsm6 \
11
  libxext6 \
12
  poppler-utils \
 
 
 
 
 
 
13
  && apt-get clean \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Thiết lập biến môi trường HOME
17
  ENV HOME=/code
18
  ENV XDG_CACHE_HOME=/code/.cache
19
 
20
- # Tạo thư mục cache và đảm bảo quyền ghi
21
  RUN mkdir -p /code/.cache && chmod -R 777 /code
22
-
23
  COPY ./requirements.txt /code/requirements.txt
24
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
25
 
26
- # Copy toàn bộ mã nguồn vào container
27
  COPY . .
28
 
29
- # Lệnh để chạy ứng dụng với Uvicorn
30
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
 
1
+ FROM python:3.11-slim
 
2
 
 
3
  WORKDIR /code
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  ffmpeg \
7
  libsm6 \
8
  libxext6 \
9
  poppler-utils \
10
+ libatk1.0-0 \
11
+ libatk-bridge2.0-0 \
12
+ libcups2 \
13
+ libxcomposite1 \
14
+ libxdamage1 \
15
+ libatspi2.0-0 \
16
  && apt-get clean \
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
19
  ENV HOME=/code
20
  ENV XDG_CACHE_HOME=/code/.cache
21
 
 
22
  RUN mkdir -p /code/.cache && chmod -R 777 /code
 
23
  COPY ./requirements.txt /code/requirements.txt
24
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
25
+ RUN pip install playwright
26
+ RUN playwright install-deps
27
 
 
28
  COPY . .
29
 
30
+ EXPOSE 9091
31
+
32
+ CMD ["uvicorn", "main:app", "--host", "172.16.2.229", "--port", "9091", "--reload"]