# Stage 1: Build frontend FROM node:20-alpine AS frontend-builder WORKDIR /app/frontend COPY frontend/package*.json ./ RUN npm install COPY frontend/ ./ RUN npm run build # Stage 2: Build Go backend FROM golang:1.25-alpine AS backend-builder WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . RUN go build -o airwallex-admin . # Stage 3: Final minimal image FROM alpine:3.19 RUN apk add --no-cache ca-certificates WORKDIR /app COPY --from=backend-builder /app/airwallex-admin . COPY --from=frontend-builder /app/frontend/dist ./frontend/dist RUN mkdir -p /app/data EXPOSE 8000 CMD ["./airwallex-admin"]