Oxinto-AI / Dockerfile
Ahsan
deploy: working FastAPI backend
1817f11
Raw History Blame Contribute Delete
826 Bytes
# ── 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"]