From 26c24ad12d4bf2bf1bec8cc511d56eaae21d2b92 Mon Sep 17 00:00:00 2001 From: geffzhang Date: Tue, 20 Feb 2024 09:16:29 +0800 Subject: [PATCH] feat: add dockerfile --- .dockerignore | 18 ++++++++++++++++++ Dockerfile | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..2f39ade1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +# .dockerignore + +.vscode + +node_modules + +.git +.gitattributes + +.eslintignore +.eslintrc.cjs + +.prettierrc +.pretieriignore + +README.md + +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..38829099 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:lts-alpine AS build + +WORKDIR /app + +COPY package.json ./ +COPY package-lock.json ./ +RUN npm install +COPY . ./ +RUN npm run build + +FROM nginx:stable-alpine +EXPOSE 5015 +RUN sed -i 's/80/5015/g' /etc/nginx/conf.d/default.conf +COPY --from=build /app/build /usr/share/nginx/html +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file