Spaces:
Sleeping
Sleeping
File size: 921 Bytes
bd2226d 540d948 bd2226d 540d948 bd2226d 540d948 bd2226d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# Use official Python slim image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies required by Playwright and Chromium
RUN apt-get update && apt-get install -y \
curl \
gnupg \
ca-certificates \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libgbm1 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libasound2 \
fonts-liberation \
libglib2.0-0 \
libdrm2 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install Playwright browsers
RUN playwright install --with-deps chromium
# Copy all app files
COPY . .
# Expose port for FastAPI / HF Spaces
EXPOSE 7860
# Run FastAPI via Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|