Files
zeekayandClaude Opus 5 b77071f345 Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 19:12:48 -07:00

22 lines
624 B
Docker

# syntax=docker/dockerfile:1.7
FROM golang:1.27.1-alpine AS build
ENV GOTOOLCHAIN=auto
WORKDIR /src
RUN apk add --no-cache git ca-certificates
COPY go.mod go.sum* ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/root/.cache/go-build \
GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
go build -trimpath -ldflags="-s -w" -o /out/world-gw .
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/world-gw /world-gw
# Single listener serves both /zap (WebSocket) and /mcp (JSON-RPC/SSE).
EXPOSE 9999
USER nonroot
ENTRYPOINT ["/world-gw"]