# docker build . -t docker.frappet.com/demo/qualifying-exam-cms:latest
FROM node:20-alpine as build-stage
WORKDIR /app
# optimize build speed by copy all .xx folder and 
COPY *.json .
COPY *.*s .
RUN npm i
COPY static ./static
COPY src ./src
# RUN ls
RUN npm run build
FROM node:lts-alpine
WORKDIR /app
COPY --from=build /app .
EXPOSE 80
ENV PORT=80
CMD ["node", "./build/index.js"]