FROM node:18-alpine AS frontend-builder RUN apk add make WORKDIR /_frontend RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm COPY ./_frontend/pnpm-lock.yaml ./ RUN pnpm fetch --prod COPY ./_frontend ./ RUN pnpm install -r --offline --prod RUN make build FROM golang:1.19-alpine AS backend-builder RUN apk add make WORKDIR /backend COPY go.mod go.sum ./ RUN go mod download -x COPY ./ ./ RUN make backend FROM alpine:latest AS runner WORKDIR /app COPY --from=frontend-builder /_frontend/out ./_frontend/out COPY --from=backend-builder /backend/phc-website-server ./phc-website-server COPY ./_views ./_views COPY ./_content/news ./_content/news COPY ./_content/guide ./_content/guide COPY ./_public ./_public COPY ./.env ./.env EXPOSE 8000 CMD ["./website-server"]