File size: 421 Bytes
527ba6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Use a lightweight Python image
FROM python:3.11-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy server code
COPY server.py .

# Set Environment defaults
ENV PORT=7860
ENV API_KEY="replace_in_huggingface_settings"

# Run as non-root user for security
RUN useradd -m myuser
USER myuser

# Start FastAPI with Uvicorn
CMD ["python", "server.py"]