Files
pruefwerk/Dockerfile.mcp
T
sharang 0444f18a8e
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Docs (push) Successful in 1m12s
CI / Deploy MCP (push) Successful in 4m0s
CI / Deploy Dashboard (push) Successful in 6m25s
CI / Deploy Agent (push) Successful in 9m12s
feat(platform): harden the container images (#261) (#307)
2026-09-21 17:28:23 +00:00

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"]