# ----------------------- # 1. Frontend build stage # ----------------------- FROM oven/bun:latest AS frontend-builder COPY /front-end /repo/front-end WORKDIR /repo/front-end RUN bun install && bun run build # ----------------------- # 2. Backend build stage # ----------------------- FROM golang:1.24.5-alpine AS backend-builder COPY /back-end /repo/back-end WORKDIR /repo/back-end RUN go build -o server . # ----------------------- # 3. Final stage # ----------------------- FROM alpine:latest # Set up working directory WORKDIR /app # Copy Go binary COPY --from=backend-builder /repo/back-end/server /app/server COPY --from=backend-builder /repo/back-end/pb_migrations /app/pb_migrations # Copy frontend assets COPY --from=frontend-builder /repo/front-end/dist /app/pb_public # Set entrypoint ENTRYPOINT ["./server", "--dir", "/pb_data", "serve", "--http", "0.0.0.0:8090"]