2026-01-12 02:02:52 +02:00
|
|
|
FROM node:22-alpine AS frontends
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY frontends/package*.json ./
|
|
|
|
|
COPY frontends/studio/package*.json ./studio/
|
|
|
|
|
COPY frontends/owner-tools/package*.json ./owner-tools/
|
|
|
|
|
COPY frontends/ui/package.json ./ui/
|
2026-01-09 00:16:46 +02:00
|
|
|
RUN npm ci
|
2026-01-12 02:02:52 +02:00
|
|
|
COPY frontends/ ./
|
|
|
|
|
RUN npm run build --workspace=studio --workspace=owner-tools
|
2026-01-09 00:16:46 +02:00
|
|
|
|
2026-01-09 02:49:21 +02:00
|
|
|
FROM golang:1.24-alpine AS builder
|
2026-01-09 00:16:46 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
|
|
|
|
COPY . .
|
2026-01-12 02:02:52 +02:00
|
|
|
COPY --from=frontends /app/studio/dist ./frontends/studio/dist
|
|
|
|
|
COPY --from=frontends /internal/tenant/assets/js/owner-tools.js ./internal/tenant/assets/js/owner-tools.js
|
2026-01-09 00:16:46 +02:00
|
|
|
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"]
|