chore: 增加本地生产环境模拟调试
This commit is contained in:
parent
251e666e4b
commit
b726f61708
|
@ -0,0 +1,9 @@
|
|||
FROM nginx:latest
|
||||
|
||||
COPY dist/ /app/
|
||||
RUN mkdir /cnf && chown 777 /cnf
|
||||
COPY nginx.conf /cnf/nginx.conf
|
||||
EXPOSE 5100
|
||||
WORKDIR /app
|
||||
|
||||
CMD [ "sh", "-c", "nginx -g 'daemon off;' -c /cnf/nginx.conf"]
|
|
@ -0,0 +1,28 @@
|
|||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http{
|
||||
include /etc/nginx/mime.types; #文件扩展名与文件类型映射表,否则前端不加载css
|
||||
default_type application/octet-stream; #默认文件类型
|
||||
proxy_buffer_size 128k;
|
||||
proxy_buffers 32 128k;
|
||||
proxy_busy_buffers_size 128k;
|
||||
proxy_connect_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
server {
|
||||
listen 5100;
|
||||
root /app; # 工作目录是/app 这里跟Dockerfile里相同
|
||||
underscores_in_headers on;
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
location ^~ /front/ {
|
||||
proxy_pass http://172.16.200.18:8081/;
|
||||
proxy_connect_timeout 2s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
client_max_body_size 1000m;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
"scripts": {
|
||||
"dev": "vite --config ./config/vite.config.dev.ts",
|
||||
"build": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts",
|
||||
"build:local": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts --mode development",
|
||||
"report": "cross-env REPORT=true npm run build",
|
||||
"preview": "npm run build && vite preview --host",
|
||||
"type:check": "vue-tsc --noEmit --skipLibCheck",
|
||||
|
|
Loading…
Reference in New Issue