File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
2+ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
3+ ENV UV_NO_DEV=1
4+ ENV UV_PYTHON_DOWNLOADS=0
5+ WORKDIR /app
6+ RUN --mount=type=cache,target=/root/.cache/uv \
7+ --mount=type=bind,source=uv.lock,target=uv.lock \
8+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
9+ uv sync --locked --no-install-project
10+ COPY . /app
11+ RUN --mount=type=cache,target=/root/.cache/uv \
12+ uv sync --locked
13+
14+ FROM python:3.13-slim-bookworm AS runtime
15+ RUN apt-get update \
16+ && apt-get upgrade -y \
17+ && apt-get clean \
18+ && rm -rf /var/lib/apt/lists/*
19+ RUN groupadd --system --gid 999 nonroot \
20+ && useradd --system --gid 999 --uid 999 --create-home nonroot
21+ COPY --from=builder --chown=nonroot:nonroot /app/ /app
22+ ENV PATH="/app/.venv/bin:$PATH"
23+ USER nonroot
24+ WORKDIR /app/src
25+ CMD ["python" , "-m" , "sample_python_app.main" ]
You can’t perform that action at this time.
0 commit comments