projects

holonet

A multiplayer video game backend in Go

dockerfile 565 B · 25 lines Raw
# ---- build ----FROM golang:1.27.1-alpine AS buildWORKDIR /src# dependencies first: editing Go source won't re-run this stepCOPY go.mod go.sum ./RUN go mod downloadCOPY . .RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -o /out/holonet ./cmd/holonet# ---- runtime ----FROM alpine:3.24# ca-certificates for outbound TLS, curl for poking at the service from insideRUN apk add --no-cache ca-certificates curl \    && adduser -D -u 65532 holonetCOPY --from=build /out/holonet /usr/local/bin/holonetUSER holonetEXPOSE 7432ENTRYPOINT ["holonet"]