| # Base image with Python | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all your project files | |
| COPY . . | |
| # Expose the port Flask will run on | |
| EXPOSE 7860 | |
| # Environment variable to tell Flask which file to run | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| ENV FLASK_RUN_PORT=7860 | |
| # Start the app | |
| CMD ["flask", "run"] |