build
This commit is contained in:
parent
a39d59bf68
commit
dccab97041
|
|
@ -19,9 +19,9 @@ services:
|
||||||
- ./frontend/dist:/usr/share/nginx/html # 挂载前端构建文件
|
- ./frontend/dist:/usr/share/nginx/html # 挂载前端构建文件
|
||||||
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf # 挂载 Nginx 配置
|
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf # 挂载 Nginx 配置
|
||||||
ports:
|
ports:
|
||||||
- "8001:80" # 将 Nginx 的 80 端口映射到主机的 1337 端口
|
- "8001:80" # 将 Nginx 的 80
|
||||||
depends_on:
|
depends_on:
|
||||||
- workflow-server # 确保 Sanic 服务先启动
|
- workflow-server
|
||||||
networks:
|
networks:
|
||||||
workflow:
|
workflow:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
client_max_body_size 20M;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1k;
|
||||||
|
gzip_comp_level 9;
|
||||||
|
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;
|
||||||
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html; # 前端构建文件的位置
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html; # 支持前端路由
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api { # 假设 API 路径是 /api
|
||||||
|
proxy_pass http://workflow-server:8080; # 将请求代理到 Sanic 服务
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /docs { # 假设 API 路径是 /api
|
||||||
|
proxy_pass http://workflow-server:8080/docs; # 将请求代理到 Sanic 服务
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue