FROM node:18-alpine AS server-dependencies

RUN apk -U upgrade \
  && apk add build-base python3 --no-cache

WORKDIR /app/client

COPY package.json package-lock.json .

RUN npm install npm --global \
  && npm install pnpm@9 --global \
  && pnpm import \
  && pnpm install

WORKDIR /app

COPY ../../package.json ../../package-lock.json .

RUN pnpm import \
  && pnpm install
