FROM node:18 AS frontend-builder WORKDIR /frontend COPY ./_frontend/package.json ./package.json COPY ./_frontend/package-lock.json ./package-lock.json RUN npm install COPY ./_frontend . 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 RUN apk add mdadm 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"]