wangliang 2 mēneši atpakaļ
vecāks
revīzija
8e20e80202
3 mainītis faili ar 88 papildinājumiem un 0 dzēšanām
  1. 20 0
      nginx/sop-web/Dockerfile
  2. 34 0
      nginx/sop-web/sop_dev.conf
  3. 34 0
      nginx/sop-web/sop_test.conf

+ 20 - 0
nginx/sop-web/Dockerfile

@@ -0,0 +1,20 @@
+FROM node:18 AS build-stage
+ENV TZ Asia/Shanghai
+MAINTAINER wangliang@qmth.com.cn
+
+WORKDIR /app
+COPY . .
+RUN npm config set registry http://registry.cnpmjs.org && npm config set registry http://registry.npm.taobao.org
+RUN npm install
+RUN NODE_OPTIONS=--max_old_space_size=4096 npm run build
+
+FROM nginx AS production-stage
+ENV TZ Asia/Shanghai
+MAINTAINER wangliang@qmth.com.cn
+
+WORKDIR /opt
+RUN rm /etc/nginx/conf.d/default.conf
+COPY --from=build-stage /app/dist /opt/dist
+COPY ./sop.conf /etc/nginx/conf.d/sop.conf
+
+CMD ["nginx","-g","daemon off;"]

+ 34 - 0
nginx/sop-web/sop_dev.conf

@@ -0,0 +1,34 @@
+#sop
+server {
+    listen      8081;
+    server_name  192.168.10.83;
+    add_header Cache-Control                   no-cache;
+    add_header Access-Control-Allow-Origin     *;
+
+    client_max_body_size 1024m;
+    keepalive_timeout   7200;
+    client_body_timeout 7200;
+    send_timeout 7200;
+    proxy_read_timeout 7200;
+    proxy_buffer_size 1024k;
+    proxy_buffers 16 1024k;
+    proxy_busy_buffers_size 2048k;
+    proxy_temp_file_write_size 2048k;
+
+   location ^~ / {
+        root  /opt/dist;
+        index  index.html;
+        try_files $uri $uri/ /index.html;
+   }
+
+    location ^~ /api {
+           proxy_pass http://192.168.10.83:7710;
+           proxy_set_header Host $host;
+           proxy_set_header X-Real-IP $remote_addr;
+           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location ^~ /static/ {
+            root /opt/;
+    }
+}

+ 34 - 0
nginx/sop-web/sop_test.conf

@@ -0,0 +1,34 @@
+#sop
+server {
+    listen      8082;
+    server_name  192.168.10.83;
+    add_header Cache-Control                   no-cache;
+    add_header Access-Control-Allow-Origin     *;
+
+    client_max_body_size 1024m;
+    keepalive_timeout   7200;
+    client_body_timeout 7200;
+    send_timeout 7200;
+    proxy_read_timeout 7200;
+    proxy_buffer_size 1024k;
+    proxy_buffers 16 1024k;
+    proxy_busy_buffers_size 2048k;
+    proxy_temp_file_write_size 2048k;
+
+   location ^~ / {
+        root  /opt/dist;
+        index  index.html;
+        try_files $uri $uri/ /index.html;
+   }
+
+    location ^~ /api {
+           proxy_pass http://192.168.10.83:7720;
+           proxy_set_header Host $host;
+           proxy_set_header X-Real-IP $remote_addr;
+           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location ^~ /static/ {
+            root /opt/;
+    }
+}