- Dockerfile.cli: multi-stage build for exploredns CLI tool - Dockerfile.web: multi-stage build for the HTTP API/web server - Both use golang:1.24-alpine builder + alpine:3.21 final image - CI pipeline docker job builds and pushes to gitea.hansenits.com.au registry on push to main/master Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>
23 lines
373 B
Docker
23 lines
373 B
Docker
# Build stage
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
WORKDIR /src
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
|
|
|
|
# Final stage
|
|
FROM alpine:3.21
|
|
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
COPY --from=builder /out/server /usr/local/bin/server
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["server"]
|