File size: 570 Bytes
5648613
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Dockerfile
FROM python:3.9-slim

# Set a working directory
# WORKDIR /app
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*

# Copy dependency definitions and install them
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY . .

# Expose the port that uvicorn will listen on (Hugging Face Spaces uses port 7860)
EXPOSE 7860

# Start the FastAPI app with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# CMD ["python", "app.py"]