Spaces:
Runtime error
Runtime error
Download Dockerfile from SamuelTheo/soft-computing-ai: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/spaces/SamuelTheo/soft-computing-ai/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/SamuelTheo/soft-computing-ai/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/SamuelTheo/soft-computing-ai/resolve/main/Dockerfile
806 Bytes
| # syntax=docker/dockerfile:1 | |
| FROM python:3.12-slim AS build | |
| COPY --from=ghcr.io/astral-sh/uv:0.8.21 /uv /uvx /bin/ | |
| WORKDIR /app | |
| ENV UV_COMPILE_BYTECODE=1 | |
| ENV UV_LINK_MODE=copy | |
| COPY uv.lock pyproject.toml ./ | |
| RUN --mount=type=cache,id=uv-cache,target=/root/.cache/uv \ | |
| uv sync --no-install-project --no-dev | |
| COPY . . | |
| RUN --mount=type=cache,id=uv-cache,target=/root/.cache/uv \ | |
| uv sync --frozen --no-dev | |
| FROM python:3.12-slim AS runtime | |
| ENV PATH="/app/.venv/bin:$PATH" | |
| RUN groupadd -g 1001 appgroup && \ | |
| useradd -u 1001 -g appgroup -m -d /app -s /bin/false appuser | |
| WORKDIR /app | |
| COPY --from=build --chown=appuser:appgroup /app . | |
| USER appuser | |
| EXPOSE 8000 | |
| ENTRYPOINT ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |