Spaces:
Runtime error
Runtime error
Download Dockerfile from HAK-Tech/ciro-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/HAK-Tech/ciro-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/HAK-Tech/ciro-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/HAK-Tech/ciro-backend/resolve/main/Dockerfile
1.37 kB
| # ββ Stage 1: Build ββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim AS builder | |
| # Install uv | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| WORKDIR /app | |
| # Copy dependency manifests first (Docker layer caching) | |
| COPY pyproject.toml uv.lock ./ | |
| # Install production dependencies only β frozen ensures lockfile is respected | |
| RUN uv sync --frozen --no-dev --no-install-project | |
| # Copy application source | |
| COPY src/ src/ | |
| COPY README.md ./ | |
| # Install the project itself | |
| RUN uv sync --frozen --no-dev | |
| # ββ Stage 2: Runtime ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # UV is needed at runtime for 'uv run' | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| WORKDIR /app | |
| # Copy the entire virtual environment and source from builder | |
| COPY --from=builder /app /app | |
| # Port is supplied by the host (Cloud Run: 8080, HF Spaces: 7860). | |
| # Default to 8080 for local runs when PORT is unset. | |
| ENV PORT=8080 | |
| EXPOSE ${PORT} | |
| # Shell form so ${PORT} is expanded at runtime by the host environment. | |
| CMD ["sh", "-c", "uv run uvicorn backend.main:app --host 0.0.0.0 --port ${PORT:-8080}"] | |