2026-03-25 18:42:43 -07:00
|
|
|
FROM golang:1.25-alpine AS builder
|
2026-03-15 11:39:13 -07:00
|
|
|
|
2026-03-26 14:58:36 -07:00
|
|
|
RUN apk add --no-cache git
|
2026-03-15 11:39:13 -07:00
|
|
|
WORKDIR /build
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
COPY . .
|
2026-03-25 18:42:43 -07:00
|
|
|
|
|
|
|
|
ARG VERSION=dev
|
|
|
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o /metacrypt ./cmd/metacrypt
|
2026-03-15 11:39:13 -07:00
|
|
|
|
|
|
|
|
FROM alpine:3.21
|
|
|
|
|
|
2026-06-11 11:14:46 -07:00
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
2026-03-15 11:39:13 -07:00
|
|
|
|
|
|
|
|
COPY --from=builder /metacrypt /usr/local/bin/metacrypt
|
|
|
|
|
|
2026-06-11 11:14:46 -07:00
|
|
|
# /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 /
|
2026-03-15 11:39:13 -07:00
|
|
|
|
|
|
|
|
EXPOSE 8443
|
|
|
|
|
EXPOSE 9443
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["metacrypt"]
|
|
|
|
|
CMD ["server", "--config", "/srv/metacrypt/metacrypt.toml"]
|