diff --git a/Dockerfile b/Dockerfile index ed61cdc7..40b51f31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,19 @@ # syntax=docker/dockerfile:1.6 +FROM node:22-bookworm-slim AS web +WORKDIR /web +COPY web/package.json web/package-lock.json ./ +RUN npm ci +COPY web/ ./ +RUN npm run build + FROM golang:1.23-bookworm AS builder WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . +# Overwrite the committed placeholder with the freshly-built SPA assets. +COPY --from=web /web/build ./web/build ENV CGO_ENABLED=0 RUN go build -trimpath -ldflags="-s -w" -o /out/minstrel ./cmd/minstrel