Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +10 -33
Dockerfile
CHANGED
|
@@ -1,52 +1,29 @@
|
|
| 1 |
-
# Base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system dependencies for Playwright
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
ffmpeg \
|
| 10 |
wget \
|
| 11 |
curl \
|
| 12 |
git \
|
| 13 |
-
libnss3 \
|
| 14 |
-
libatk1.0-0 \
|
| 15 |
-
libatk-bridge2.0-0 \
|
| 16 |
-
libcups2 \
|
| 17 |
-
libdrm2 \
|
| 18 |
-
libxkbcommon0 \
|
| 19 |
-
libxcomposite1 \
|
| 20 |
-
libxdamage1 \
|
| 21 |
-
libxfixes3 \
|
| 22 |
-
libxrandr2 \
|
| 23 |
-
libgbm1 \
|
| 24 |
-
libpango-1.0-0 \
|
| 25 |
-
libasound2 \
|
| 26 |
-
libatspi2.0-0 \
|
| 27 |
-
libwayland-client0 \
|
| 28 |
-
libx11-xcb1 \
|
| 29 |
-
fonts-liberation \
|
| 30 |
-
libappindicator3-1 \
|
| 31 |
-
libxshmfence1 \
|
| 32 |
-
libxext6 \
|
| 33 |
-
libx11-6 \
|
| 34 |
-
libxss1 \
|
| 35 |
-
libxcursor1 \
|
| 36 |
&& rm -rf /var/lib/apt/lists/*
|
| 37 |
|
| 38 |
-
# Copy
|
| 39 |
-
COPY .
|
| 40 |
|
| 41 |
-
# Install Python dependencies
|
| 42 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 43 |
|
| 44 |
# Install Playwright browsers
|
| 45 |
-
RUN playwright install chromium
|
| 46 |
|
| 47 |
-
#
|
|
|
|
|
|
|
|
|
|
| 48 |
EXPOSE 7860
|
| 49 |
ENV PORT=7860
|
| 50 |
|
| 51 |
-
#
|
| 52 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies for Playwright + FFmpeg
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
ffmpeg \
|
| 8 |
wget \
|
| 9 |
curl \
|
| 10 |
git \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Copy only requirements first (cache layer)
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
|
|
|
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
# Install Playwright browsers
|
| 19 |
+
RUN pip install playwright && playwright install chromium
|
| 20 |
|
| 21 |
+
# Copy all code
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
# Expose FastAPI port
|
| 25 |
EXPOSE 7860
|
| 26 |
ENV PORT=7860
|
| 27 |
|
| 28 |
+
# Run app
|
| 29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
|