Spaces:
Sleeping
Sleeping
Download Dockerfile from hashir-qt/keyvault-api: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/hashir-qt/keyvault-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/hashir-qt/keyvault-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/hashir-qt/keyvault-api/resolve/main/Dockerfile
1.18 kB
| # ββ Build stage ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.13-slim AS builder | |
| # Install uv (fast Python package manager) | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| WORKDIR /app | |
| # Copy dependency files first (layer caching) | |
| COPY pyproject.toml uv.lock ./ | |
| # Install production deps into .venv | |
| RUN uv sync --frozen --no-dev | |
| # ββ Runtime stage βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.13-slim AS runtime | |
| WORKDIR /app | |
| # Copy venv from builder | |
| COPY --from=builder /app/.venv /app/.venv | |
| # Copy application source | |
| COPY src/ ./src/ | |
| # Make the venv the active Python | |
| ENV PATH="/app/.venv/bin:$PATH" | |
| # Hugging Face Spaces requires port 7860 | |
| EXPOSE 7860 | |
| # Non-root user for security | |
| RUN useradd -m -u 1000 appuser && chown -R appuser /app | |
| USER appuser | |
| CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"] | |