Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +6 -24
Dockerfile
CHANGED
|
@@ -1,27 +1,6 @@
|
|
| 1 |
# Use the official Python 3.11 slim image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Install system dependencies required for Playwright (Chromium) and PDF generation
|
| 5 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
-
wget \
|
| 7 |
-
gnupg \
|
| 8 |
-
libnss3 \
|
| 9 |
-
libatk1.0-0 \
|
| 10 |
-
libatk-bridge2.0-0 \
|
| 11 |
-
libcups2 \
|
| 12 |
-
libdrm2 \
|
| 13 |
-
libxkbcommon0 \
|
| 14 |
-
libxcomposite1 \
|
| 15 |
-
libxdamage1 \
|
| 16 |
-
libxext6 \
|
| 17 |
-
libxfixes3 \
|
| 18 |
-
librandr2 \
|
| 19 |
-
libgbm1 \
|
| 20 |
-
libpango-1.0-0 \
|
| 21 |
-
libcairo2 \
|
| 22 |
-
libasound2 \
|
| 23 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
-
|
| 25 |
# Create a non-root user (required by Hugging Face Spaces and best practice for security)
|
| 26 |
RUN useradd -m -u 1000 user
|
| 27 |
WORKDIR /home/user/app
|
|
@@ -29,9 +8,12 @@ WORKDIR /home/user/app
|
|
| 29 |
# Copy requirements first to leverage Docker cache
|
| 30 |
COPY --chown=user:user requirements.txt .
|
| 31 |
|
| 32 |
-
# Install Python packages
|
| 33 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
# Copy the rest of the application files
|
| 37 |
COPY --chown=user:user . .
|
|
|
|
| 1 |
# Use the official Python 3.11 slim image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Create a non-root user (required by Hugging Face Spaces and best practice for security)
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
WORKDIR /home/user/app
|
|
|
|
| 8 |
# Copy requirements first to leverage Docker cache
|
| 9 |
COPY --chown=user:user requirements.txt .
|
| 10 |
|
| 11 |
+
# Install Python packages
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Install Playwright browser and its exact system dependencies automatically
|
| 15 |
+
RUN playwright install chromium
|
| 16 |
+
RUN playwright install-deps chromium
|
| 17 |
|
| 18 |
# Copy the rest of the application files
|
| 19 |
COPY --chown=user:user . .
|