-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (21 loc) · 790 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (21 loc) · 790 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
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
WORKDIR /app
# Install dependencies first (cached unless lockfile changes)
COPY pyproject.toml uv.lock ./
RUN uv sync --no-dev --frozen --no-install-project
# Copy source and install the project itself
COPY README.md ./
COPY src/ src/
RUN uv sync --no-dev --frozen --no-editable
FROM python:3.13-slim-bookworm
# Real-time log output
ENV PYTHONUNBUFFERED=1
# Non-root user
RUN groupadd --system appuser && useradd --system --gid appuser appuser
# Copy the virtualenv from the builder
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["python", "-c", "import varaosabotti"]
USER appuser
ENTRYPOINT ["varaosabotti"]