2026-03-23 16:45:40 +10:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
# Syntrex GoMCP — Multi-stage build
|
|
|
|
|
|
|
|
|
|
# ─── Build stage ────────────────────────────────────
|
|
|
|
|
FROM golang:1.25-alpine AS builder
|
|
|
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Build static binary (modernc/sqlite = pure Go, no CGO needed).
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gomcp ./cmd/gomcp
|
|
|
|
|
|
|
|
|
|
# ─── Runtime stage ──────────────────────────────────
|
|
|
|
|
FROM alpine:3.20
|
|
|
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY --from=builder /gomcp /app/gomcp
|
|
|
|
|
|
2026-03-31 09:19:15 +10:00
|
|
|
RUN addgroup -S syntrex && adduser -S syntrex -G syntrex
|
|
|
|
|
RUN mkdir -p /data/.rlm && chown -R syntrex:syntrex /data
|
|
|
|
|
USER syntrex
|
2026-03-23 16:45:40 +10:00
|
|
|
|
|
|
|
|
EXPOSE 9750
|
|
|
|
|
|
|
|
|
|
ENV RLM_DIR=/data/.rlm
|
|
|
|
|
ENV GOMCP_HTTP_PORT=9750
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/app/gomcp"]
|
|
|
|
|
CMD ["--http-port", "9750"]
|