Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Stage 1: Define a minimal stage to extract the 'uv' binary
# This is a multi-stage build to use uv for dependency management and is necessary to ensure the the image version we pull is for the right architecture.
# This is automatically set by the buildx builder. when using --platoform linux/amd64,linux/arm64 argument and then
# using FROM in the Dockerfile.
FROM ghcr.io/astral-sh/uv:0.4.0 AS uv_extractor


# Stage 2: The main application build stage
FROM python:3.12-slim

ARG TARGETARCH
Expand Down Expand Up @@ -39,7 +47,11 @@
## Install dependencies and copy GitOps server.
##
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:0.4.0 /uv /bin/uv



# Copy the uv binary from the uv image to the final image.
COPY --from=uv_extractor /uv /bin/uv
COPY --link=true pyproject.toml uv.lock /app/
RUN --mount=type=cache,target=/root/.cache/ \
(uv sync --frozen --no-install-project --extra server || uv sync --frozen --no-install-project --extra server)
Expand All @@ -50,7 +62,7 @@
COPY gitops /app/gitops/
COPY gitops_server /app/gitops_server

ENV GIT_CRYPT_KEY_FILE=/app/cluster.key

Check warning on line 65 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Docker Image / ci

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "GIT_CRYPT_KEY_FILE") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV PYTHONPATH="$PYTHONPATH:/app"

Check warning on line 66 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Docker Image / ci

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV ACCESS_LOG=""

Expand Down