FROM harbor.merlin.xin/mirrors/docker.io/library/node:20-bullseye AS build

WORKDIR /app

COPY package*.json ./

RUN --mount=type=cache,target=/root/.npm \
    npm install

COPY . .

RUN npm run build


FROM harbor.merlin.xin/mirrors/docker.io/library/nginxinc/nginx-unprivileged:stable

COPY --from=build /app/dist /app/dist