cf / Dockerfile
Hiro121234's picture
Upload 12 files
1f82855 verified
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libwayland-client0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxkbcommon0 \
libxrandr2 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install Chromium for Patchright
RUN python -m patchright install chromium
# Copy application
COPY app.py .
# Expose port
EXPOSE 7860
# Set environment variables
ENV PORT=7860
ENV PYTHONUNBUFFERED=1
# Run the application
CMD ["python", "app.py"]