diff --git a/backend/Dockerfile b/backend/Dockerfile index 401eb536a3..f694654f5e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,3 +1,6 @@ +# ============================================================================== +# Frontend: build +# ============================================================================== FROM oven/bun:1 AS frontend-build WORKDIR /app @@ -15,15 +18,18 @@ ARG VITE_API_URL= RUN bun run build +# ============================================================================== +# Dependency: pull in the standalone uv binary +# ============================================================================== +FROM ghcr.io/astral-sh/uv:0.12.2 AS uv-binary -FROM python:3.14 +# ============================================================================== +# Runtime: backend build + app run +# ============================================================================== +FROM python:3.14 AS runtime ENV PYTHONUNBUFFERED=1 -# Install uv -# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/ - # Compile bytecode # Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode ENV UV_COMPILE_BYTECODE=1 @@ -38,6 +44,9 @@ WORKDIR /app/ # Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment ENV PATH="/app/.venv/bin:$PATH" +# provision package manager +COPY --from=uv-binary /uv /usr/local/bin/uv + # Install dependencies # Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers RUN --mount=type=cache,target=/root/.cache/uv \