chd vor 1 Jahr
Ursprung
Commit
274d689c84
3 geänderte Dateien mit 59 neuen und 0 gelöschten Zeilen
  1. 7 0
      Dockerfile
  2. 13 0
      docker-app-compose.yml
  3. 39 0
      nginx.conf

+ 7 - 0
Dockerfile

@@ -0,0 +1,7 @@
+FROM nginx:1.16
+
+ENV TZ="Asia/Shanghai"
+ENV NGINX_PORT=8088
+EXPOSE ${NGINX_PORT}
+COPY dist/  /usr/share/nginx/html/
+COPY nginx.conf /etc/nginx/nginx.conf

+ 13 - 0
docker-app-compose.yml

@@ -0,0 +1,13 @@
+version: '3'
+services:
+  hrsk-official-ui:                      # 指定服务的名称
+    image: "hrsk-official-ui:${h5_tag_name}"                         # 镜像名 .注意:${app_tag_name} 变量名不能带'-'符号,第一个'-'后会认为是默认值,而非变量名的一部分。
+    environment:                        # 环境变量
+      - VIRTUAL_HOST=loan-hrsk-official.internal.jiebide.xin          # nginx-proxy 所用域名
+    networks:                           # 网络 (用于容器间通信)
+      - nginx-proxy
+
+networks:                               # 定义网络
+  nginx-proxy:
+    external:
+      name: nginx-proxy

+ 39 - 0
nginx.conf

@@ -0,0 +1,39 @@
+worker_processes auto;
+
+events {
+    worker_connections 1024;
+}
+
+http {
+ include             mime.types;
+
+ default_type        application/octet-stream;
+
+ sendfile            on;
+
+ keepalive_timeout 65;
+
+ client_max_body_size 20m;
+
+    server {
+        listen       80;
+        server_name  localhost;
+
+
+        location / {
+        	rewrite '^/(.*)\.br$' /br?channelCode=$1 permanent;
+			root /usr/share/nginx/html; #配置Vue项目根路径,与
+			index index.html index.html; #配置首页
+			try_files $uri $uri/ /index.html; #防止刷新报404
+        }
+
+        #error_page 404 /404.html;
+            #location = /40x.html {
+        #}
+
+        error_page 500 502 503 504 /50x.html;
+            location = /50x.html {
+			root html;
+        }
+    }
+ }