File size: 784 Bytes
b5aaa24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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
# Include gunicorn as a dependency to run the Flask app
RUN pip3 install -r requirements.txt gunicorn

# Define the command to run the Flask application using Gunicorn
# 'app:SuperKart_predictions_api' specifies the module (app.py) and the Flask app instance name (SuperKart_predictions_api)
# -b 0.0.0.0:7860 binds Gunicorn to all network interfaces on port 7860 (default for Hugging Face Spaces Docker SDK)
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:SuperKart_predictions_api"]