hrms-exam/cms/docker/Dockerfile

18 lines
434 B
Text
Raw Permalink Normal View History

2023-04-04 12:38:01 +07:00
# docker build . -t docker.frappet.com/demo/qualifying-exam-cms:latest
2024-12-23 09:48:05 +00:00
FROM node:20-alpine AS build-stage
2023-03-14 13:47:44 +07:00
WORKDIR /app
2023-04-11 00:53:08 +07:00
# optimize build speed by copy all .xx folder and
2024-12-23 09:51:43 +00:00
COPY cms/*.json .
COPY cms/*.*s .
2023-04-11 00:53:08 +07:00
RUN npm i
2024-12-23 09:51:43 +00:00
COPY cms/static ./static
COPY cms/src ./src
2023-03-14 13:47:44 +07:00
RUN npm run build
2024-12-23 09:48:05 +00:00
FROM node:lts-alpine AS production-stage
2023-03-14 13:47:44 +07:00
WORKDIR /app
2024-12-23 09:48:05 +00:00
COPY --from=build-stage /app .
2023-03-14 13:47:44 +07:00
EXPOSE 80
ENV PORT=80
2024-12-23 09:48:05 +00:00
CMD ["node", "./build/index.js"]