Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ==============================================================================
# Frontend: build
# ==============================================================================
FROM oven/bun:1 AS frontend-build

WORKDIR /app
Expand All @@ -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
Expand All @@ -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 \
Expand Down