fix: alembic version_num 长度修复 + 前端部署配置

- env.py: 自动创建 alembic_version 表时使用 VARCHAR(255) 避免截断
- docker-compose: 添加 frontend nginx 服务 + alembic 挂载
- nginx.conf: SPA 路由 + API 代理
This commit is contained in:
shangfangjian
2026-09-17 01:26:58 +08:00
parent 312778d995
commit 1219b4fd18
2 changed files with 32 additions and 2 deletions
+13 -1
View File
@@ -6,7 +6,7 @@ services:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD 未设置}
POSTGRES_DB: ${POSTGRES_DB:-football}
ports:
- "${POSTGRES_PORT:-5432}:5432"
- "${POSTGRES_PORT:-5433}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
@@ -26,6 +26,18 @@ services:
condition: service_healthy
volumes:
- ./src:/app/src
- ./alembic:/app/alembic
- ./alembic.ini:/app/alembic.ini
frontend:
image: nginx:alpine
ports:
- "${FRONTEND_PORT:-3000}:80"
volumes:
- ./frontend/dist:/usr/share/nginx/html
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
volumes:
pgdata: