# Use a minimal base image with Python 3.9 installed FROM python:3.9-slim # Set the working directory inside the container to /app WORKDIR /app # Copy all files from the current directory on the host to the container's /app directory COPY . . # Install Python dependencies listed in requirements.txt RUN pip install --no-cache-dir -r requirements.txt RUN pip install gunicorn flask # Expose the port the Flask app will run on (Hugging Face Spaces default to 7860 for Docker SDK) EXPOSE 7860 # Define the command to run the Flask application using gunicorn CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]