File size: 555 Bytes
5a0e1c3
 
81567a6
5a0e1c3
81567a6
 
5a0e1c3
81567a6
 
5a0e1c3
 
 
81567a6
5a0e1c3
 
81567a6
5a0e1c3
 
 
 
81567a6
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 for better compatibility with modern libraries
FROM python:3.10-slim

# Set the working directory
WORKDIR /code

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

# Upgrade pip and install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r /code/requirements.txt

# Copy the rest of the files
COPY . .

# Grant permissions (sometimes needed for HF Spaces)
RUN chmod -R 777 /code

# Start the app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]