| # Use a minimal base image with Python 3.9 installed | |
| FROM python:3.9-slim | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Copy all files from the current directory on the host (including the model and app.py) | |
| # to the container's working directory | |
| COPY . . | |
| # Install dependencies from the requirements file | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Define the command to start the application using Gunicorn | |
| # CRITICAL FIX: The command correctly points to the app file and instance name: | |
| # {python_file}:{flask_instance} | |
| CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:sales_predictor_api"] | |