File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11# https://github.com/astral-sh/uv-docker-example/blob/c16a61fb3e6ab568ac58d94b73a7d79594a5d570/Dockerfile
2- FROM python:3.13-slim
2+
3+ # Build stage
4+ FROM python:3.13-slim AS builder
35
46WORKDIR /app
57
6- ENV PATH="/app/.venv/bin:$PATH"
78ENV UV_COMPILE_BYTECODE=1
89ENV UV_LINK_MODE=copy
910ENV UV_PROJECT_ENVIRONMENT=/usr/local
@@ -22,4 +23,18 @@ ADD . /app
2223RUN --mount=type=cache,target=/root/.cache/uv \
2324 uv sync --frozen --no-dev
2425
26+ # Runtime stage
27+ FROM python:3.13-slim
28+
29+ WORKDIR /app
30+
31+ # Copy installed packages from builder
32+ COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
33+ COPY --from=builder /usr/local/bin /usr/local/bin
34+
35+ # Copy only the source code directory needed at runtime
36+ COPY --from=builder /app/src/stac_auth_proxy /app/src/stac_auth_proxy
37+
38+ ENV PYTHONPATH=/app/src
39+
2540CMD ["python" , "-m" , "stac_auth_proxy" ]
You can’t perform that action at this time.
0 commit comments