Bladeren bron

Merge branch 'master' of http://laoyanghome.cn:18081/jc-wangyt/netFlowPlatform

jc-wangyt 1 maand geleden
bovenliggende
commit
6896de8372
3 gewijzigde bestanden met toevoegingen van 53 en 0 verwijderingen
  1. 13 0
      Dockerfile
  2. 7 0
      dockerbuild.bat
  3. 33 0
      nginx.conf

+ 13 - 0
Dockerfile

@@ -0,0 +1,13 @@
+FROM nginx
+
+# 复制自定义nginx配置
+COPY nginx.conf /etc/nginx/conf.d/
+
+# 复制Vue打包文件到nginx目录
+COPY dist/ /usr/share/nginx/html/
+
+# 暴露80端口
+EXPOSE 80
+
+# 启动nginx
+CMD ["nginx", "-g", "daemon off;"]

+ 7 - 0
dockerbuild.bat

@@ -0,0 +1,7 @@
+docker build -t netflowplatform:latest ./ --platform=linux/arm64/v8 -f Dockerfile
+
+docker login --username=changqing7 10.130.16.8:30028 -p "Changqing7@2025!"
+
+docker tag netflowplatform:latest 10.130.16.8:30028/hygl-hltest-ecr/netflowplatform:latest
+
+docker push 10.130.16.8:30028/hygl-hltest-ecr/netflowplatform:latest

+ 33 - 0
nginx.conf

@@ -0,0 +1,33 @@
+server {
+    listen 80;
+    server_name localhost;
+
+    # 开启gzip压缩
+    gzip on;
+    gzip_min_length 1k;
+    gzip_comp_level 9;
+    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;
+    index index.html;
+
+    # 处理Vue路由(避免404)
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+
+    # 静态资源缓存
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+        expires 1y;
+        add_header Cache-Control "public, immutable";
+    }
+
+    # 禁止访问隐藏文件
+    location ~ /\. {
+        deny all;
+    }
+}
+