Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +1 -25
Dockerfile
CHANGED
|
@@ -1,33 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# install apt deps commonly needed by Playwright/Chromium
|
| 5 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
-
wget curl ca-certificates gnupg unzip \
|
| 7 |
-
libnss3 libatk1.0-0 libatk-bridge2.0-0t64 libcups2 \
|
| 8 |
-
libxcomposite1 libxdamage1 libxrandr2 libxss1 libasound2 \
|
| 9 |
-
fonts-liberation libdbus-1-3 \
|
| 10 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
WORKDIR /app
|
| 13 |
-
|
| 14 |
-
# copy app files
|
| 15 |
COPY requirements.txt /app/requirements.txt
|
| 16 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 17 |
|
| 18 |
-
# make Playwright put browsers in a writable location inside container
|
| 19 |
-
ENV PLAYWRIGHT_BROWSERS_PATH=/app/.cache/playwright
|
| 20 |
-
RUN mkdir -p /app/.cache/playwright
|
| 21 |
-
|
| 22 |
-
# install Playwright browsers (chromium) with required OS deps
|
| 23 |
-
# --with-deps asks Playwright to install OS dependencies where supported
|
| 24 |
-
RUN python -m playwright install --with-deps chromium
|
| 25 |
-
|
| 26 |
-
# copy app code
|
| 27 |
COPY . /app
|
| 28 |
-
|
| 29 |
-
# expose port (Spaces default is 7860)
|
| 30 |
EXPOSE 7860
|
| 31 |
-
|
| 32 |
-
# run the app
|
| 33 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM mcr.microsoft.com/playwright/python:latest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
|
|
|
|
|
|
| 4 |
COPY requirements.txt /app/requirements.txt
|
| 5 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
COPY . /app
|
|
|
|
|
|
|
| 8 |
EXPOSE 7860
|
|
|
|
|
|
|
| 9 |
CMD ["python", "app.py"]
|