File size: 617 Bytes
3bac63f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use slim Python for a small image
FROM python:3.10-slim

# Prevent Python from buffering stdout/stderr (so you see logs immediately)
ENV PYTHONUNBUFFERED=1

# Set the working directory
WORKDIR /app

# Copy and install only requirements first (leverages Docker cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy your application code
COPY . .


EXPOSE 7860

# Default command: run Uvicorn against your FastAPI app in app.py
# Replace "app:app" if your FastAPI instance is named differently or in another module
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]