Explorar o código

add dockerfile

Zhang Li %!s(int64=2) %!d(string=hai) anos
pai
achega
fe9d394dca
Modificáronse 1 ficheiros con 24 adicións e 0 borrados
  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