build: generate templ files inside docker build

This commit is contained in:
2026-04-08 17:03:34 +02:00
parent 341c2fae54
commit b09be86ec8

View File

@@ -5,11 +5,17 @@ WORKDIR /app
# Enable CGO for sqlite3
ENV CGO_ENABLED=1
# Install templ
RUN go install github.com/a-h/templ/cmd/templ@latest
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Generate templ files
RUN templ generate
# Build the server and the CLI tools
RUN go build -o main_server ./cmd/server