FROM golang:1.25-alpine AS builder RUN apk add --no-cache git WORKDIR /build COPY go.mod go.sum ./ RUN go mod download COPY . . ARG VERSION=dev RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o /metacrypt ./cmd/metacrypt FROM alpine:3.21 RUN apk add --no-cache ca-certificates tzdata COPY --from=builder /metacrypt /usr/local/bin/metacrypt # /srv/metacrypt (config, certs/, metacrypt.db) is bind-mounted at runtime by # MCP. No VOLUME / pre-created dir / USER — the agent supplies --user 0:0, so # the image unpacks and runs cleanly under rootless podman. WORKDIR / EXPOSE 8443 EXPOSE 9443 ENTRYPOINT ["metacrypt"] CMD ["server", "--config", "/srv/metacrypt/metacrypt.toml"]