2025-12-03 03:21:12 -08:00
|
|
|
FROM golang:1.24-alpine
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-01-16 04:26:56 -08:00
|
|
|
# Install Chromium and dependencies for chromedp
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
|
chromium \
|
|
|
|
|
nss \
|
|
|
|
|
freetype \
|
|
|
|
|
harfbuzz \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
ttf-freefont
|
|
|
|
|
|
|
|
|
|
# Set environment variable for chromedp to find chromium
|
|
|
|
|
ENV CHROME_BIN=/usr/bin/chromium-browser \
|
|
|
|
|
CHROME_PATH=/usr/bin/chromium-browser
|
|
|
|
|
|
2025-12-03 03:21:12 -08:00
|
|
|
# Copy go.mod and go.sum first
|
|
|
|
|
COPY go/go.mod go/go.sum ./
|
|
|
|
|
|
|
|
|
|
# Download dependencies
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
# Install Air for hot reload (pinned to v1.52.3 for Go 1.24 compatibility)
|
|
|
|
|
RUN go install github.com/air-verse/air@v1.52.3
|
|
|
|
|
# Install sqlc for SQL code generation
|
|
|
|
|
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
|
|
|
|
|
|
|
|
|
# Copy source code
|
|
|
|
|
COPY go/ .
|
|
|
|
|
|
|
|
|
|
# Generate sqlc code
|
|
|
|
|
RUN sqlc generate
|
|
|
|
|
|
2026-01-16 04:26:56 -08:00
|
|
|
# Ensure static assets are available
|
|
|
|
|
COPY go/static ./static
|
|
|
|
|
|
2025-12-03 03:21:12 -08:00
|
|
|
# Copy Air config
|
|
|
|
|
COPY go/.air.toml .air.toml
|
|
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
|
|
CMD ["air", "-c", ".air.toml"]
|