Browse Source

add dockerfile

Zhang Li 2 years ago
parent
commit
fe9d394dca
1 changed files with 24 additions and 0 deletions
  1. 24 0
      Dockerfile

+ 24 - 0
Dockerfile

@@ -0,0 +1,24 @@
+FROM node:14-buster as build
+WORKDIR /workspace
+COPY package.json .
+RUN npm install
+ADD . /workspace
+RUN npm run build
+
+
+FROM nginx:mainline
+WORKDIR /usr/share/nginx/html
+COPY --from=build /workspace/build /usr/share/nginx/html/dag
+RUN echo "\
+server {\n\
+    listen 80;\n\
+    listen [::]:80;\n\
+\n\
+    root /usr/share/nginx/html/dag;\n\
+    index index.html index.htm;\n\
+\n\
+    location / {\n\
+    try_files \$uri \$uri/ =404;\n\
+    }\n\
+}\n\
+" > /etc/nginx/conf.d/default.conf