部署环境优化
This commit is contained in:
@@ -11,6 +11,7 @@ services:
|
|||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker_env/nginx/my.conf:/etc/nginx/conf.d/my.conf
|
- ./docker_env/nginx/my.conf:/etc/nginx/conf.d/my.conf
|
||||||
|
- ./backend/media:/backend/media
|
||||||
expose:
|
expose:
|
||||||
- "8080"
|
- "8080"
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -30,4 +30,22 @@ server {
|
|||||||
rewrite ^/api/(.*)$ /$1 break; #重写
|
rewrite ^/api/(.*)$ /$1 break; #重写
|
||||||
proxy_pass http://177.10.0.12:8000/; # 设置代理服务器的协议和地址
|
proxy_pass http://177.10.0.12:8000/; # 设置代理服务器的协议和地址
|
||||||
}
|
}
|
||||||
|
location /media {
|
||||||
|
alias /backend/media;
|
||||||
|
expires 7d;
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1k;
|
||||||
|
gzip_comp_level 2;
|
||||||
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
||||||
|
gzip_vary on;
|
||||||
|
}
|
||||||
|
location /api/media {
|
||||||
|
alias /backend/media;
|
||||||
|
expires 7d;
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1k;
|
||||||
|
gzip_comp_level 2;
|
||||||
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
||||||
|
gzip_vary on;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/dvadmin3-base-web:16.19-alpine
|
FROM registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/dvadmin3-base-web:16.19-alpine
|
||||||
WORKDIR /web/
|
WORKDIR /web/
|
||||||
COPY web/. .
|
COPY web/. .
|
||||||
RUN yarn install --registry=https://registry.npm.taobao.org
|
RUN yarn install --registry=https://registry.npmmirror.com
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|||||||
Reference in New Issue
Block a user