-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 921 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Build stage
FROM python:3.13-slim-bookworm AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
# Copy the project into the intermediate image
COPY . /app
# Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-editable --no-default-groups --python-preference only-system
# Final image stage
FROM python:3.13-slim-bookworm AS final
RUN apt-get update && apt-get install curl jq -y --no-install-recommends \
&& apt clean
RUN useradd --user-group --system --create-home --no-log-init app \
&& mkdir -p /app \
&& chown -R app:app /app
WORKDIR /app
COPY --chown=app:app . /app
COPY --from=builder --chown=app:app --chmod=755 /app/.venv /app/.venv
COPY --chown=app:app --chmod=755 docker/start.sh /app/start.sh
RUN chmod +x /app/.venv/bin/*
USER app
ENV VENV_PATH=/app/.venv
ENV PATH="/app/.venv/bin:$PATH"
ENTRYPOINT ["/app/start.sh"]