File size: 623 Bytes
efc65a6
 
 
 
 
 
 
 
 
 
 
 
 
3ede8fd
efc65a6
 
 
 
3ede8fd
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use an official lightweight Python image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file first to leverage Docker cache
COPY requirements.txt .

# Install dependencies without caching to keep the image slim
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY main.py .

# Expose the port the app runs on
EXPOSE 5000

# Command to run the Uvicorn server for production
# We use main:app to specify the file (main.py) and the FastAPI instance (app)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]