Files
stpweb/backend/Dockerfile
T
adamfandClaude Opus 5.5 4530cb8dc4
Test and deploy / test (push) Successful in 28s
Test and deploy / deploy (push) Successful in 31s
Trim comments to the non-obvious why
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]>
2026-11-24 20:49:03 +00:00

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"]