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 /app/client/
RUN npm install npm@latest --global \
  && npm install pnpm --global \
  && pnpm import \
  && pnpm install


WORKDIR /app/
COPY ../../package.json ../../package-lock.json /app/
RUN pnpm import \
  && pnpm install
