Files
pruefwerk/Dockerfile.dashboard
T
sharang 2157ae2d42
CI / Agent integration (push) Skipped
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 6s
CI / Deploy Docs (push) Skipped
CI / Deploy MCP (push) Successful in 4m40s
CI / Deploy Dashboard (push) Successful in 6m12s
CI / Deploy Agent (push) Successful in 8m36s
fix(telemetry): service.version reports the release, not the crate version (#883)
2026-11-05 17:32:27 +00:00

51 lines
2.1 KiB
Docker

FROM rust:1.94-bookworm AS builder
RUN cargo install dioxus-cli --version 0.7.3 --locked
# Legal pages linked from the sidebar; the defaults are breakpilot.com's.
ARG IMPRINT_URL=https://breakpilot.com/impressum
ARG PRIVACY_URL=https://breakpilot.com/datenschutz
# The release telemetry reports as service.version (CI passes the latest
# release tag); empty falls back to the crate version.
ARG PRUEFWERK_VERSION=
WORKDIR /app
COPY . .
ENV IMPRINT_URL=${IMPRINT_URL} \
PRIVACY_URL=${PRIVACY_URL}
# compliance-agent (a workspace member) depends on the private firmwerk git
# repo, so the workspace resolve needs it even to build the dashboard.
# Authenticate the fetch with a PAT passed as a BuildKit secret.
RUN --mount=type=secret,id=git_token \
if [ -s /run/secrets/git_token ]; then \
git config --global \
url."https://platform-ci:$(cat /run/secrets/git_token)@git.breakpilot.com/".insteadOf \
"ssh://git@git.breakpilot.com:22222/"; \
fi && \
CARGO_NET_GIT_FETCH_WITH_CLI=true dx build --release --package compliance-dashboard
FROM debian:bookworm-slim
# curl only serves the healthcheck.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libssl3 curl \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --uid 10001 --user-group --no-create-home --shell /usr/sbin/nologin app
# eMudhra (Mozilla bug 2083449, Oct 2026): fail the build if the image still
# trusts the compromised root. Also keeps a cached layer with the old store
# from being reused.
RUN test ! -e /usr/share/ca-certificates/mozilla/emSign_ECC_Root_CA_-_G3.crt
WORKDIR /app
COPY --from=builder /app/target/dx/compliance-dashboard/release/web/compliance-dashboard /app/compliance-dashboard
COPY --from=builder /app/target/dx/compliance-dashboard/release/web/public /app/public
ENV IP=0.0.0.0
# Sessions live in Mongo, so the dashboard writes nothing to its filesystem.
USER app
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD curl -fsS "http://127.0.0.1:${PORT:-8080}/health" || exit 1
ENTRYPOINT ["./compliance-dashboard"]