Spaces:
Running on Zero
Running on Zero
File size: 1,219 Bytes
7a8be67 377a8d6 7a8be67 377a8d6 8f2f8a9 377a8d6 7a8be67 377a8d6 7a8be67 111581b 8f2f8a9 7a8be67 377a8d6 7a8be67 377a8d6 8f2f8a9 7a8be67 377a8d6 7a8be67 377a8d6 7a8be67 377a8d6 7a8be67 377a8d6 8f2f8a9 | 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 45 46 47 48 49 50 51 52 53 | FROM python:3.9-slim
WORKDIR /app
# Install only essential dependencies that definitely exist in Debian Trixie
RUN apt-get update && apt-get install -y \
wget \
gnupg \
curl \
libnss3 \
libatk-bridge2.0-0 \
libx11-6 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libxss1 \
libasound2 \
libgtk-3-0 \
libgbm1 \
libcups2 \
libdbus-1-3 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install playwright==1.46.0
RUN playwright install --with-deps chromium
# Install Playwright with minimal dependencies
RUN playwright install chromium
# Copy application files
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
# Create necessary directories
RUN mkdir -p /tmp
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Start the application
CMD ["python","app.py","uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |