FROM node:18.20.4-alpine3.20

WORKDIR /app

RUN npm install -g pnpm
COPY package*.json .
COPY pnpm-lock.yaml .
RUN pnpm install --prefer-offline=true --frozen-lockfile=true
RUN npm i -g serve

COPY . .
ENV NODE_ENV=production

RUN pnpm build

EXPOSE 3000

CMD [ "serve", "-s", "dist" ]
