FROM node:22.11.0-alpine3.20 AS build

WORKDIR /app

RUN npm install -g --force corepack \
	&& corepack enable

COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

COPY . .
RUN pnpm run build

RUN mkdir -p /output && cp -r /app/build/. /output/

VOLUME /output
