# ---- Build stage ---- FROM docker.io/golang:1.24-bookworm AS builder RUN apt-get update && apt-get install -y --no-install-recommends \ libsqlite3-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . RUN CGO_ENABLED=1 go build -o pdf-form-filler . # ---- Runtime stage ---- FROM docker.io/debian:bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends \ default-jre-headless \ pdftk \ poppler-utils \ && rm -rf /var/lib/apt/lists/* ENV TZ=UTC WORKDIR /app COPY --from=builder /app/pdf-form-filler . COPY templates/ ./templates/ COPY static/ ./static/ RUN mkdir -p data EXPOSE 8080 CMD ["./pdf-form-filler"]