pixeldrain / Dockerfile
nexacore's picture
Update Dockerfile
87d3007 verified
# Use a Python base image (ensures compatibility)
FROM python:3.10-slim
# Install Playwright's system dependencies, ensuring correct package names for Debian Trixie/13
RUN apt-get update \
&& apt-get install -y \
wget \
procps \
libnss3 \
libxcomposite1 \
libxrandr2 \
libgbm-dev \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libatspi2.0-0 \
libgtk-3-0 \
libfontconfig1 \
libglib2.0-0 \
# Add the recommended replacement for the obsolete package, if necessary.
# Let's try running without the specific gdk-pixbuf package first,
# as often the other installed packages satisfy the dependencies.
# If it fails again, we will re-add 'libgdk-pixbuf-xlib-2.0-0'.
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Crucial step: Download Playwright browsers
RUN playwright install chromium
# Copy your FastAPI app
COPY app.py .
# Define the command to run your FastAPI application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]