File size: 909 Bytes
faf052d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f91f4dd
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Dockerfile

# Use the official, full Python image for best compatibility
FROM python:3.11

# Set the working directory inside the container
WORKDIR /app

# Install system dependencies listed in packages.txt
COPY packages.txt .
RUN apt-get update && xargs -a packages.txt apt-get install -y --no-install-recommends && apt-get clean && rm -rf /var/lib/apt/lists/*

# Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application code
COPY . .

# --- THIS IS THE DEFINITIVE STARTUP COMMAND ---
# It tells the container exactly how to run the web server.
# Gunicorn is a robust process manager for production.
# It uses Uvicorn workers to handle the async FastAPI code.
# It binds to port 7860 on all network interfaces.
CMD ["gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "app:app"]