chore: 补充部署编排配置

- 增加 Docker Compose、共享服务初始化脚本与 Nginx 配置

- 补充部署环境应用配置与数据库初始化脚本
This commit is contained in:
2026-03-20 12:45:00 +08:00
parent 9605384edc
commit 425d8dd455
7 changed files with 270 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
upstream easycard_backend {
server 127.0.0.1:8112;
keepalive 32;
}
server {
listen 80;
server_name _;
client_max_body_size 20m;
location = /card {
return 301 /card/;
}
# 按服务器实际路径替换为前端 dist 目录。
root /root/easycard/dist;
index index.html;
# 仅将 /card/api 前缀映射到后端 8112 服务。
# 例如:/card/api/v1/system/ping -> /api/v1/system/ping
location ^~ /card/api/ {
rewrite ^/card(/.*)$ $1 break;
proxy_pass http://easycard_backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Prefix /card;
proxy_redirect off;
}
# 托管前端静态资源与 history 路由。
location ^~ /card/ {
rewrite ^/card/(.*)$ /$1 break;
try_files $uri $uri/ /index.html;
}
}