File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Build stage
2- FROM python:3.13-slim-bookworm AS builder
3- COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
2+ FROM ghcr.io/astral-sh/uv:python3.13-alpine AS builder
43
54WORKDIR /app
65
7- # Install dependencies
8- RUN --mount=type=cache,target=/root/.cache/uv \
9- --mount=type=bind,source=uv.lock,target=uv.lock \
10- --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
11- uv sync --locked --no-install-project --no-editable
12-
136# Copy the project into the intermediate image
147ADD . /app
158
169# Sync the project
1710RUN --mount=type=cache,target=/root/.cache/uv \
18- uv sync --locked --no-editable
11+ uv sync --locked --no-editable --no-default-groups
1912
2013# Final image stage
21- FROM python:3.13-slim-bookworm
22-
23- # Use Bash
24- SHELL ["/bin/bash" , "-c" ]
14+ FROM python:3.13-alpine
2515
26- RUN useradd --user-group --system --create-home --no-log-init app
16+ RUN addgroup -S app && adduser -S -G app app
2717USER app
2818
2919WORKDIR /app
@@ -32,4 +22,4 @@ COPY --from=builder --chown=app:app /app/.venv /app/.venv
3222COPY src/ /app
3323COPY docker/ /app
3424
35- CMD ["/bin/bash " , "start.sh" ]
25+ CMD ["/bin/sh " , "start.sh" ]
You can’t perform that action at this time.
0 commit comments