File size: 660 Bytes
81f703a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use an official Python runtime as a parent image
FROM python:3.9-slim-buster

# Set the working directory in the container
WORKDIR /app

# Install any needed packages specified in requirements.txt
# First, copy just the requirements.txt to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Expose port 7860 as requested by the user for Hugging Face Spaces
EXPOSE 7860

# Command to run the application
# Use Uvicorn to run FastAPI, binding to 0.0.0.0 and the exposed port
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]