FROM node:23.7.0-alpine3.21 as builder

WORKDIR /app

COPY package*.json ./
RUN npm ci && npm cache clean --force

COPY . ./

RUN npm install -g vite
RUN npx vite build

FROM nginx:alpine

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

EXPOSE 3006

CMD ["nginx", "-g", "daemon off;"]
