# Use a lightweight Python base image FROM python:3.11-slim # Set working directory inside the container WORKDIR /app # Copy dependency list first (for Docker caching) COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy your Flask app code into the container COPY . . # Expose the port Flask will run on EXPOSE 7860 # Environment variables to make Flask run properly ENV FLASK_APP=app.py ENV FLASK_RUN_HOST=0.0.0.0 ENV FLASK_ENV=production # Command to run your Flask app CMD ["python", "app.py"]