CoolFace
Apppublic

S-Dreamer/CodeCraftLab

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
Dockerfile46 linesDownload Raw Back to root
1# --------------------------------------------------------------------------2# CodeCraftLab — Dockerfile3# FastAPI + Uvicorn on port 80004# Runs as non-root user (HF Spaces requirement)5# --------------------------------------------------------------------------6FROM python:3.11-slim AS base7 8# System deps9RUN apt-get update && apt-get install -y --no-install-recommends \10    git \11    git-lfs \12    build-essential \13    && git lfs install \14    && apt-get clean \15    && rm -rf /var/lib/apt/lists/*16 17# Non-root user (required by HuggingFace Spaces)18RUN useradd -m -u 1000 appuser19WORKDIR /app20 21# --------------------------------------------------------------------------22FROM base AS deps23 24COPY pyproject.toml uv.lock* ./25RUN pip install uv --no-cache-dir && \26    uv sync --no-dev --frozen27 28# --------------------------------------------------------------------------29FROM base AS runtime30 31COPY --from=deps /app/.venv /app/.venv32ENV PATH="/app/.venv/bin:$PATH"33 34COPY --chown=appuser:appuser . .35 36USER appuser37 38EXPOSE 800039 40# Uvicorn — 4 workers in production, 1 in development (override with env)41CMD ["uvicorn", "app:app", \42     "--host", "0.0.0.0", \43     "--port", "8000", \44     "--workers", "4", \45     "--log-config", "null"]46