Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +49 -16
Dockerfile
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
|
4 |
-
# Cài đặt các thư viện và gói hệ thống
|
5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
6 |
libglib2.0-0 \
|
7 |
libnss3 \
|
@@ -21,42 +20,76 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
21 |
libxrandr2 \
|
22 |
libgbm1 \
|
23 |
libpango-1.0-0 \
|
|
|
24 |
libatspi2.0-0 \
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
python3-pip \
|
30 |
python3-venv \
|
31 |
ffmpeg \
|
32 |
libsm6 \
|
33 |
libxext6 \
|
34 |
poppler-utils \
|
35 |
-
libatk1.0-0 \
|
36 |
-
libatk-bridge2.0-0 \
|
37 |
-
libcups2 \
|
38 |
-
libxcomposite1 \
|
39 |
-
libxdamage1 \
|
40 |
-
libatspi2.0-0 \
|
41 |
chromium \
|
42 |
&& apt-get clean \
|
43 |
&& rm -rf /var/lib/apt/lists/*
|
44 |
|
45 |
-
# Cài đặt môi trường ảo
|
46 |
RUN python3 -m venv /code/venv
|
47 |
ENV PATH="/code/venv/bin:$PATH"
|
|
|
|
|
48 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
|
|
|
|
49 |
RUN pip install playwright
|
50 |
RUN playwright install
|
51 |
|
52 |
# Sao chép mã nguồn
|
53 |
COPY ./requirements.txt /code/requirements.txt
|
54 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
55 |
COPY . .
|
56 |
|
57 |
-
#
|
|
|
|
|
|
|
58 |
EXPOSE 7860
|
59 |
EXPOSE 9222
|
60 |
|
61 |
# Khởi động ứng dụng
|
62 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
FROM ubuntu:24.04
|
2 |
|
3 |
+
# Cập nhật và cài đặt các gói hệ thống cần thiết
|
|
|
4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
5 |
libglib2.0-0 \
|
6 |
libnss3 \
|
|
|
20 |
libxrandr2 \
|
21 |
libgbm1 \
|
22 |
libpango-1.0-0 \
|
23 |
+
libcairo2 \
|
24 |
libatspi2.0-0 \
|
25 |
+
libwoff1 \
|
26 |
+
libopus0 \
|
27 |
+
libwebp7 \
|
28 |
+
libwebpdemux2 \
|
29 |
+
libenchant-2-2 \
|
30 |
+
libgudev-1.0-0 \
|
31 |
+
libsecret-1-0 \
|
32 |
+
libhyphen0 \
|
33 |
+
libgdk-pixbuf2.0-0 \
|
34 |
+
libegl1 \
|
35 |
+
libnotify4 \
|
36 |
+
libxslt1.1 \
|
37 |
+
libevent-2.1-7 \
|
38 |
+
libgles2 \
|
39 |
+
libepoxy0 \
|
40 |
+
libgtk-3-0 \
|
41 |
+
libharfbuzz-icu0 \
|
42 |
+
libgstreamer-gl1.0-0 \
|
43 |
+
libgstreamer-plugins-bad1.0-0 \
|
44 |
+
gstreamer1.0-plugins-good \
|
45 |
+
gstreamer1.0-plugins-bad \
|
46 |
+
libxt6 \
|
47 |
+
libxaw7 \
|
48 |
+
xvfb \
|
49 |
+
fonts-noto-color-emoji \
|
50 |
+
libfontconfig \
|
51 |
+
libfreetype6 \
|
52 |
+
xfonts-cyrillic \
|
53 |
+
xfonts-scalable \
|
54 |
+
fonts-liberation \
|
55 |
+
fonts-ipafont-gothic \
|
56 |
+
fonts-wqy-zenhei \
|
57 |
+
fonts-tlwg-loma-otf \
|
58 |
+
fonts-freefont-ttf \
|
59 |
python3-pip \
|
60 |
python3-venv \
|
61 |
ffmpeg \
|
62 |
libsm6 \
|
63 |
libxext6 \
|
64 |
poppler-utils \
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
chromium \
|
66 |
&& apt-get clean \
|
67 |
&& rm -rf /var/lib/apt/lists/*
|
68 |
|
69 |
+
# Cài đặt môi trường ảo Python
|
70 |
RUN python3 -m venv /code/venv
|
71 |
ENV PATH="/code/venv/bin:$PATH"
|
72 |
+
|
73 |
+
# Cài đặt các thư viện Python cần thiết
|
74 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
75 |
+
|
76 |
+
# Cài đặt Playwright và các phần phụ thuộc
|
77 |
RUN pip install playwright
|
78 |
RUN playwright install
|
79 |
|
80 |
# Sao chép mã nguồn
|
81 |
COPY ./requirements.txt /code/requirements.txt
|
82 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
83 |
+
|
84 |
+
# Sao chép mã nguồn vào container
|
85 |
COPY . .
|
86 |
|
87 |
+
# Thiết lập thư mục làm việc
|
88 |
+
WORKDIR /code
|
89 |
+
|
90 |
+
# Mở các cổng cần thiết cho ứng dụng
|
91 |
EXPOSE 7860
|
92 |
EXPOSE 9222
|
93 |
|
94 |
# Khởi động ứng dụng
|
95 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|