FROM node:22-alpine AS studio WORKDIR /app/studio COPY studio/package*.json ./ RUN npm ci COPY studio/ ./ RUN npm run build FROM golang:1.23-alpine AS builder WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . COPY --from=studio /app/studio/dist ./studio/dist RUN CGO_ENABLED=0 go build -o writekit . FROM alpine:3.21 RUN apk add --no-cache ca-certificates WORKDIR /app COPY --from=builder /app/writekit . COPY --from=builder /app/internal/db/migrations ./internal/db/migrations EXPOSE 8080 CMD ["./writekit"]