CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 6m36s
- Agent, dashboard and MCP run as an unprivileged user (uid 10001). The agent writes only to its home (tool caches), /data/compliance-scanner (uploaded artifacts, the OSCAL snapshot; mount a volume there) and /tmp (git checkouts). If a volume created by an older root image is not writable, the entrypoint stops with the chown command that fixes it. - Docker HEALTHCHECKs: agent /api/v1/health, MCP /health, and a new dashboard /health route outside /api (no session needed). #262 makes the probes check dependencies. - Pinned tools: Rust 1.98.1 (installed system-wide, per-user CARGO_HOME), cargo-audit 0.22.2 (`--locked`, compiled in its own stage so the runtime has no C toolchain), syft 1.52.0 and gitleaks 8.21.2 (sha256-verified), semgrep 1.177.0 and ruff 0.16.8. They are recorded in /opt/pruefwerk/tool-versions.json for the evidence pack. - Removed Nix (store bootstrap, nix.conf, entrypoint seeding) and runtimes nothing invokes (Go, PHP, Composer, Ruby, Bundler), and install without recommended packages. The runtime layers shrink from about 1.19 GB to about 0.5 GB compressed. - .dockerignore keeps target/ (24 GB locally), node_modules, .git and .env out of the build context. - docker-compose mounts a data volume instead of a root-owned clone volume. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
34 lines
1.2 KiB
Docker
34 lines
1.2 KiB
Docker
FROM rust:1.94-bookworm AS builder
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
# compliance-agent (a workspace member) depends on the private firmwerk git
|
|
# repo, so the workspace resolve needs it even to build the mcp binary.
|
|
# 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 cargo build --release -p compliance-mcp
|
|
|
|
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
|
|
|
|
COPY --from=builder /app/target/release/compliance-mcp /usr/local/bin/compliance-mcp
|
|
|
|
ENV MCP_PORT=8090
|
|
# The MCP server writes nothing to its filesystem.
|
|
USER app
|
|
EXPOSE 8090
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD curl -fsS "http://127.0.0.1:${MCP_PORT}/health" || exit 1
|
|
|
|
ENTRYPOINT ["compliance-mcp"]
|