Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +22 -16
Dockerfile
CHANGED
|
@@ -1,16 +1,22 @@
|
|
| 1 |
-
FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
RUN pip install --no-cache-dir flask requests curl_cffi werkzeug loguru python-dotenv patchright
|
| 6 |
-
|
| 7 |
-
RUN python -m patchright install --with-deps chrome
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
RUN pip install --no-cache-dir flask requests curl_cffi werkzeug loguru python-dotenv patchright
|
| 6 |
+
|
| 7 |
+
RUN python -m patchright install --with-deps chrome
|
| 8 |
+
|
| 9 |
+
# 创建 /data 目录并设置权限
|
| 10 |
+
RUN mkdir -p /data && chmod 755 /data
|
| 11 |
+
|
| 12 |
+
COPY . .
|
| 13 |
+
|
| 14 |
+
# 确保以适当的用户运行
|
| 15 |
+
USER root
|
| 16 |
+
|
| 17 |
+
ENV PORT=5200
|
| 18 |
+
ENV PYTHONUNBUFFERED=1
|
| 19 |
+
|
| 20 |
+
EXPOSE 5200
|
| 21 |
+
|
| 22 |
+
CMD ["python", "app.py"]
|