mirror of
https://github.com/hanzoai/world-zap.git
synced 2026-10-30 14:55:43 +00:00
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]>
22 lines
624 B
Docker
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"]
|