# Fallback only — used when the repo has no Dockerfile of its own (see
# buildDocker.groovy). Simplified from the real go-Dockerfile: no SSH-keyed
# private module auth (github.com/Homelab/*), no per-module builds, no
# kafka-specific CGO toggle. Assumes a standard single-binary repo layout
# (main package at the repo root) — a repo with a different structure
# should just bring its own Dockerfile, same as demo-go-app does.
FROM golang:${version}-alpine AS build
WORKDIR /src
COPY go.mod go.sum* ./
RUN go mod download 2>/dev/null || true
COPY . .
RUN CGO_ENABLED=0 go build -o /app .

FROM alpine:3.20
COPY --from=build /app /app
EXPOSE 8080
ENTRYPOINT ["/app"]
