diff --git a/.env.hella11 b/.env.hella11 new file mode 100644 index 0000000..caf8028 --- /dev/null +++ b/.env.hella11 @@ -0,0 +1,12 @@ +# 页面标题 +VITE_APP_TITLE = QAD对外接口 + +# 生产环境配置 +VITE_APP_ENV = 'test' + +# 若依管理系统/生产环境 +VITE_APP_BASE_API = 'http://172.21.32.11:23111/api' +VITE_APP_BASE_API_IMAGE = 'http://172.21.32.11:23111' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/.env.hella12 b/.env.hella12 new file mode 100644 index 0000000..d8bb146 --- /dev/null +++ b/.env.hella12 @@ -0,0 +1,12 @@ +# 页面标题 +VITE_APP_TITLE = QAD对外接口 + +# 生产环境配置 +VITE_APP_ENV = 'test' + +# 若依管理系统/生产环境 +VITE_APP_BASE_API = 'http://172.21.32.12:23111/api' +VITE_APP_BASE_API_IMAGE = 'http://172.21.32.12:23111' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/.env.production b/.env.production deleted file mode 100644 index 984c9ca..0000000 --- a/.env.production +++ /dev/null @@ -1,12 +0,0 @@ -# 页面标题 -VITE_APP_TITLE = 鸿翔TMS - -# 生产环境配置 -VITE_APP_ENV = 'production' - -# 若依管理系统/生产环境 -VITE_APP_BASE_API = 'https://tmsdata.hongxianggroup.com.cn' -VITE_APP_BASE_API_IMAGE = 'https://tms.hongxianggroup.com.cn' - -# 是否在打包时开启压缩,支持 gzip 和 brotli -VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/.env.test b/.env.test index e14dd51..d8bb146 100644 --- a/.env.test +++ b/.env.test @@ -5,8 +5,8 @@ VITE_APP_TITLE = QAD对外接口 VITE_APP_ENV = 'test' # 若依管理系统/生产环境 -VITE_APP_BASE_API = 'http://10.62.193.14:23111/api' -VITE_APP_BASE_API_IMAGE = 'http://10.62.193.14:23111' +VITE_APP_BASE_API = 'http://172.21.32.12:23111/api' +VITE_APP_BASE_API_IMAGE = 'http://172.21.32.12:23111' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e484efb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# 设置基础镜像 +FROM win-nginx + +WORKDIR /opt/qad +COPY nginx.conf /usr/local/nginx/conf/nginx.conf +# 将dist文件中的内容复制到 /opt/sfms3.0 这个目录下面 +COPY dist/ /opt/qad diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..ea45032 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,69 @@ +user root; +worker_processes 2; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include mime.types; + charset utf-8,gbk; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; + + proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; + access_log logs/access.log main; + sendfile on; + #tcp_nopush on; + keepalive_timeout 600s; + client_max_body_size 200m; + gzip on; + gzip_min_length 10k; + gzip_comp_level 9; + gzip_buffers 4 16k; + gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + upstream data-manager { + server localhost:23112 weight=10 max_fails=3 fail_timeout=10s; + } + server { + listen 23111; + server_name_in_redirect off; + server_name _; + access_log logs/tms.log main; + location /api/ { + access_log logs/tms-manager.log main; + proxy_pass http://data-manager/; + proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; + proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $http_x_forwarded_for; + } + location /profile/ { + proxy_cache my_zone; + proxy_cache_valid 200 304 12h; + proxy_cache_key $host$uri$is_args$args; + alias /opt/uploadPath/; + index index.html index.htm; + } + location / { + proxy_cache my_zone; + proxy_cache_valid 200 304 12h; + proxy_cache_key $host$uri$is_args$args; + try_files $uri $uri/ /index.html; + root /opt/qad; + index index.html index.htm; + } + } +} + diff --git a/package.json b/package.json index 6c870dd..4d10448 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "dev": "vite", "test": "vite build --mode test", - "prod": "vite build --mode production", + "hella11": "vite build --mode hella11", + "hella12": "vite build --mode hella12", "preview": "vite preview" }, "repository": {