File size: 651 Bytes
9b2f059
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16d485a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.9-slim

# Set the working directory inside the container
WORKDIR /app

# Copy dependency file first (better layer caching)
COPY requirements.txt .

# Install dependencies without cache
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of the code
COPY . .

# Environment variable for Hugging Face Spaces (or Docker run)
ENV PORT=7860

# Expose the port
EXPOSE $PORT

# Start the Flask app using Gunicorn with 4 worker processes
# - "app:extraaLearn_predictor_api" → app.py has Flask instance named extraaLearn_predictor_api
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:extraaLearn_predictor_api"]