fix go build with sqlite

This commit is contained in:
Travis Shears 2025-10-07 12:04:34 +02:00
parent 0bd065c2d1
commit f6b6c8a7e6
2 changed files with 6 additions and 4 deletions

View file

@ -3,8 +3,8 @@ FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install git if needed for go mod
RUN apk add --no-cache git
# Install git, gcc, musl-dev, and sqlite-dev for go mod and CGO
RUN apk add --no-cache git gcc musl-dev sqlite-dev
# Copy go mod and sum files
COPY go.mod go.sum ./
@ -15,6 +15,9 @@ RUN go mod download
COPY main.go .
COPY internal ./internal
# Enable CGO for go-sqlite3
ENV CGO_ENABLED=1
RUN go build -o main .
FROM alpine:latest