Browse Source

chore: fix deploy script

Sendya 3 years ago
parent
commit
a4a7e59a05
3 changed files with 39 additions and 0 deletions
  1. 6 0
      Dockerfile
  2. 9 0
      deploy/caddy.conf
  3. 24 0
      deploy/nginx.conf

+ 6 - 0
Dockerfile

@@ -0,0 +1,6 @@
+FROM nginx
+
+RUN rm /etc/nginx/conf.d/default.conf
+
+ADD deploy/nginx.conf /etc/nginx/conf.d/default.conf
+COPY dist/ /usr/share/nginx/html/

+ 9 - 0
deploy/caddy.conf

@@ -0,0 +1,9 @@
+0.0.0.0:80 {
+  gzip
+  root /usr/share/nginx/html
+
+  rewrite {
+    r .*
+    to {path} /
+  }
+}

+ 24 - 0
deploy/nginx.conf

@@ -0,0 +1,24 @@
+server {
+    listen 80;
+    server_name  _;
+    # gzip config
+    gzip on;
+    gzip_min_length 1k;
+    gzip_comp_level 6;
+    gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
+    gzip_vary on;
+    gzip_disable "MSIE [1-6]\.";
+
+    root /usr/share/nginx/html;
+    include /etc/nginx/mime.types;
+
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+
+#    location /api {
+#        proxy_pass https://preview.pro.antdv.com/api;
+#        proxy_set_header   X-Forwarded-Proto $scheme;
+#        proxy_set_header   X-Real-IP         $remote_addr;
+#    }
+}