edit Dockerfile

This commit is contained in:
Suchin Sapphasitthatha 2024-12-23 09:48:05 +00:00
parent 6ebb08b67c
commit cf901d1ee1

View file

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