From d07d6a6ccc1990198b5d8f1b5e3fb5020103567e Mon Sep 17 00:00:00 2001 From: Viet Anh Nguyen Date: Mon, 5 Feb 2024 18:44:17 +0700 Subject: [PATCH] Add Dockerfile --- cope2n-fe/Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cope2n-fe/Dockerfile diff --git a/cope2n-fe/Dockerfile b/cope2n-fe/Dockerfile new file mode 100644 index 0000000..76bc6c7 --- /dev/null +++ b/cope2n-fe/Dockerfile @@ -0,0 +1,21 @@ +FROM node:21-alpine AS build + +WORKDIR /app/ +COPY --chown=node:node package*.json ./ +RUN npm install +COPY --chown=node:node . . +RUN npm run build +RUN npm cache clean --force +USER node + +################### +# PRODUCTION +################### +FROM nginx:stable-alpine AS nginx + +COPY --from=build /app/dist/ /usr/share/nginx/html/ +COPY --from=build /app/run.sh /app/ +COPY --from=build /app/nginx.conf /configs/ +RUN chmod +x /app/run.sh + +CMD ["/app/run.sh"]