FROM node:20-alpine AS builder

WORKDIR /uradibou

COPY src/package*.json ./

RUN npm install
COPY src .
RUN npm run build


FROM docker.io/nginx

RUN rm -rf /usr/share/nginx/html/*

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

EXPOSE 80

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