File size: 723 Bytes
2930dae
5b64237
2930dae
 
 
 
5b64237
2930dae
 
 
 
5b64237
2930dae
 
 
5b64237
2930dae
 
 
 
 
 
 
11f8f10
 
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
# ---------------------------------------------------------------
# DevOpsEnv — Hugging Face Spaces Docker container
# Space SDK: Docker  |  Port: 7860
# ---------------------------------------------------------------
FROM python:3.11-slim

# Create non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 appuser

WORKDIR /app

# Install Python dependencies first (layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY --chown=appuser:appuser . .

USER appuser

# Expose the port HF Spaces expects
EXPOSE 7860

# Start the FastAPI server (No --reload in production)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]