-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 973 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (30 loc) · 973 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
39
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim AS build-app
# Set environment for building the app
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=0
WORKDIR /app
# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-dev
# Install the app
COPY ./src ./pyproject.toml ./uv.lock /app/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-dev
FROM python:3.14-alpine AS runtime
# Install iptables
RUN apk add --no-cache iptables
# Copy the application from app-builder
COPY --from=build-app /app /app
# Set up environment to run the app
ENV PATH="/app/.venv/bin:$PATH"
ENV LOG_LEVEL=DEBUG
ENV INTERVAL=60
ENV DRY_RUN=false
# Volumes
VOLUME /var/run/docker.sock
VOLUME /zones
# Run
WORKDIR /app
CMD ["python", "-m", "portalias.main.main"]