File size: 826 Bytes
bd1531f
 
1817f11
bd1531f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
# ── Oxinto AI β€” Production Dockerfile for Hugging Face Spaces ────────────────
# SDK: Docker  |  Port: 7860  |  Python: 3.10
FROM python:3.10

# HF Spaces requires UID 1000
RUN useradd -m -u 1000 appuser

WORKDIR /app

# Install dependencies first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
 && pip install --no-cache-dir -r requirements.txt

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

# Create __init__.py files so Python treats dirs as packages
RUN touch routes/__init__.py services/__init__.py models/__init__.py

# Switch to non-root user
USER appuser

EXPOSE 7860

# Start FastAPI on port 7860 (required by HF Spaces)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--log-level", "info"]