2025-07-23 04:22:50 -07:00
|
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
|
|
|
|
|
|
RUN apk add --no-cache git
|
2025-07-23 03:40:54 -07:00
|
|
|
WORKDIR /app
|
2025-11-22 17:30:24 -08:00
|
|
|
COPY go/go.mod go/go.sum ./
|
2025-07-23 04:22:50 -07:00
|
|
|
RUN go mod download
|
2025-11-22 17:30:24 -08:00
|
|
|
COPY go/ .
|
2025-07-23 04:22:50 -07:00
|
|
|
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
|
|
|
|
RUN sqlc generate
|
2025-11-19 05:42:29 -08:00
|
|
|
RUN go mod tidy
|
2025-07-23 04:22:50 -07:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server cmd/server/main.go
|
|
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2026-01-18 05:11:41 -08:00
|
|
|
RUN apk --no-cache add ca-certificates tzdata chromium nss freetype harfbuzz ttf-freefont
|
|
|
|
|
|
|
|
|
|
# Set environment variable for chromedp to find chromium
|
|
|
|
|
ENV CHROME_BIN=/usr/bin/chromium-browser \
|
|
|
|
|
CHROME_PATH=/usr/bin/chromium-browser
|
|
|
|
|
|
2026-01-16 04:26:56 -08:00
|
|
|
WORKDIR /app
|
2025-07-23 04:22:50 -07:00
|
|
|
COPY --from=builder /app/server .
|
2026-01-21 01:05:08 -08:00
|
|
|
COPY go/templates ./templates
|
2026-01-21 05:14:27 -08:00
|
|
|
COPY go/internal/cmc/documents/templates ./templates/pdf
|
2025-11-22 17:30:24 -08:00
|
|
|
COPY go/static ./static
|
|
|
|
|
COPY go/.env.example .env
|
2025-07-23 03:40:54 -07:00
|
|
|
EXPOSE 8082
|
|
|
|
|
CMD ["./server"]
|