FROM node:22 as build

WORKDIR /app

RUN npm install -g pnpm

COPY package*.json .

RUN pnpm install

COPY . .

RUN npm run build

FROM nginx:latest

COPY ./nginx.conf /etc/nginx/conf.d/default.conf

COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80