FROM node:18 AS frontend-builder WORKDIR /frontend COPY ./_frontend . RUN npm install RUN npm run build FROM golang:1.18-alpine AS server-builder WORKDIR /server COPY go.mod go.sum ./ RUN go mod download -x COPY . . RUN go build -buildvcs=false -o storage-server -v . FROM alpine:latest AS runner WORKDIR /app COPY --from=frontend-builder /frontend/dist ./_frontend/dist COPY ./scripts ./scripts COPY --from=server-builder /server/storage-server ./storage-server EXPOSE 4000 CMD ["./storage-server"]