FROM python:3.9-slim WORKDIR /app # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create uploads directory RUN mkdir -p uploads # Set environment variables ENV PORT=7860 ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 # Expose the port EXPOSE 7860 # Command to run the application CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]