File size: 648 Bytes
3603ded
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b789b98
 
3603ded
 
b789b98
 
3603ded
b789b98
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Base image with Python pre-installed
FROM python:3.11-slim

# Set working directory inside container
WORKDIR /app

# Copy requirements first (for layer caching)
COPY requirements.txt .

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

# Copy application code
COPY src/ ./src/

# HF Spaces requires port 7860
EXPOSE 7860

# Health check for production monitoring
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \
  CMD curl -f http://localhost:7860/health || exit 1

# Command to run when container starts (HF Spaces uses port 7860)
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"]