FROM python:3.10-slim # ========================================== # Environment Setup # ========================================== ENV PYTHONUNBUFFERED=1 ENV PORT=7860 WORKDIR /app # ========================================== # Install system dependencies # ========================================== RUN apt-get update && apt-get install -y \ git \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # ========================================== # Copy app files # ========================================== COPY app.py /app/app.py COPY requirements.txt /app/requirements.txt # Create writable cache directory RUN mkdir -p /app/cache && chmod -R 777 /app/cache # ========================================== # Install Python dependencies # ========================================== RUN pip install --no-cache-dir -r requirements.txt # ========================================== # Expose port # ========================================== EXPOSE 7860 # ========================================== # Run app # ========================================== CMD ["python", "app.py"]