File size: 554 Bytes
2620d7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bd75eed
2620d7d
bd75eed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use Python 3.10
FROM python:3.10

# Set working directory to /code
WORKDIR /code

# Copy requirements
COPY ./requirements.txt /code/requirements.txt

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

# Copy the source code
COPY ./src /code/src

# Create a writable directory for caching/temp files if needed
RUN mkdir -p /code/temp && chmod 777 /code/temp

# Set the command to run the Flask application
# Note: HF Spaces expects the app to run on port 7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "src.app:app"]