Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (46 loc) · 2.78 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (46 loc) · 2.78 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# syntax=docker/dockerfile:1
#
# Multi-stage, distroless runtime. Released as a multi-arch (amd64/arm64)
# image at ghcr.io/geckonia/ruprogress-mcp by .github/workflows/release.yml;
# for a local build pin a single arch on the command line, e.g.:
# docker build --platform linux/arm64 -t ruprogress-mcp:dev .
#
# Both base images are pinned by tag *and* digest: the tag fixes the distro
# (so Dependabot can only bump the digest within it, never silently jump
# distro the way an untagged `rust@sha256:` reference tracks `:latest`), and
# the digest makes a rebuild a rebuild, not a lottery. Builder and runtime are
# both Debian trixie deliberately, so the shipped binary's glibc matches what
# it was linked against. Both are multi-arch OCI indexes (amd64/arm64/…), so
# the release matrix needs no digest change per arch. .github/workflows/docker.yml
# smoke-tests every base-image bump before it reaches main.
FROM rust:1.100-trixie@sha256:e84068000361bf3d4a5ba2b7647f62893528b1eb9f847d7a23b493f5ce8ea254 AS builder
WORKDIR /build
COPY . .
RUN cargo build --locked --release --bin ruprogress-mcp
# distroless has no shell to `mkdir` the attachments volume's mount point
# with the right owner, so seed it here and copy it across with --chown.
RUN mkdir -p /build/attachments-seed && chmod 700 /build/attachments-seed
FROM gcr.io/distroless/cc-debian13:nonroot@sha256:29ee70762214fe8190cea04ef1c0a84a8365879e047ce8f911ae5a5ab2355fa2
ARG VERSION=dev
LABEL org.opencontainers.image.source="https://github.com/geckonia/ruprogress-mcp" \
org.opencontainers.image.description="MCP server exposing Redmine's REST API to MCP clients over stdio and streamable HTTP" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="${VERSION}"
COPY --from=builder /build/target/release/ruprogress-mcp /usr/local/bin/ruprogress-mcp
# uid/gid 65532 is the image's built-in "nonroot" user.
COPY --from=builder --chown=65532:65532 /build/attachments-seed /var/lib/ruprogress-mcp/attachments
# A container's network namespace is the isolation loopback binding relies on
# on a bare host; SERVER_HOST=0.0.0.0 alone is a startup error until
# PUBLIC_HOST (or REDMINE_MCP_ALLOWED_HOSTS) is also set — see
# docs/configuration.md#exposing-the-server-on-a-network.
ENV SERVER_HOST=0.0.0.0
ENV ATTACHMENTS_DIR=/var/lib/ruprogress-mcp/attachments
VOLUME ["/var/lib/ruprogress-mcp/attachments"]
EXPOSE 8000
# /livez only — never /readyz, which depends on Redmine and would turn a
# Redmine outage into a restart loop. Orchestrator readiness probes should
# point at /readyz separately (see docker-compose.yml).
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ["/usr/local/bin/ruprogress-mcp", "--healthcheck"]
ENTRYPOINT ["/usr/local/bin/ruprogress-mcp"]
CMD ["--transport", "http"]