Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
32 lines
684 B
Docker
32 lines
684 B
Docker
# Static binary (CGO_ENABLED=0) on a slim base. ca-certificates for outbound
|
|
# HTTPS; the cache mounts keep rebuilds fast.
|
|
FROM golang:1.26 AS builder
|
|
|
|
WORKDIR /backend
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
go mod download
|
|
|
|
COPY . ./
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 go build -o main .
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
# For the compose healthcheck.
|
|
RUN apt-get update \
|
|
&& apt-get install --yes --no-install-recommends ca-certificates wget \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /backend
|
|
|
|
COPY --from=builder /backend/main ./main
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["./main"]
|