Update Dockerfile
Browse files- Dockerfile +9 -9
Dockerfile
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
gnupg \
|
| 7 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
|
| 12 |
-
RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
RUN playwright install --with-deps chromium
|
| 16 |
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
#
|
|
|
|
|
|
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Set environment variables so Playwright works in a limited environment
|
| 4 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/app/pw-browsers
|
| 5 |
+
ENV HOME=/app
|
|
|
|
|
|
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
RUN apt-get update && apt-get install -y wget gnupg && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 10 |
|
| 11 |
+
RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
|
| 12 |
+
# Install browser in the local app folder
|
| 13 |
RUN playwright install --with-deps chromium
|
| 14 |
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
+
# Give full permissions to the app folder
|
| 18 |
+
RUN chmod -R 777 /app
|
| 19 |
+
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|