main #7
@@ -58,6 +58,8 @@ $images | ForEach-Object { docker pull $_ }
|
|||||||
| Compute API | `19100` | `9100` | 算力服务器 API |
|
| Compute API | `19100` | `9100` | 算力服务器 API |
|
||||||
| File Gateway | `19101` | 后续服务端口 | 当前预留,后续拆出文件网关服务时使用 |
|
| File Gateway | `19101` | 后续服务端口 | 当前预留,后续拆出文件网关服务时使用 |
|
||||||
|
|
||||||
|
注意:`8000` 是后端容器内部端口,不作为宿主机对外访问端口。宿主机或浏览器应访问 `http://<app-server-ip>:17861/modelTF/health`;前端 Nginx 容器在 Docker 网络内部访问 `http://backend-api:8000/modelTF/...`。
|
||||||
|
|
||||||
对应配置文件:
|
对应配置文件:
|
||||||
|
|
||||||
- `docker/app/.env.example`
|
- `docker/app/.env.example`
|
||||||
@@ -79,6 +81,8 @@ $images | ForEach-Object { docker pull $_ }
|
|||||||
|
|
||||||
应用服务器包含前端 Nginx、Backend API、PostgreSQL、Redis。
|
应用服务器包含前端 Nginx、Backend API、PostgreSQL、Redis。
|
||||||
|
|
||||||
|
当前 Compose 内置 PostgreSQL 使用 `backend/app/db/sql/001_platform_runtime.sql` 初始化运行库。`docs/postgres-schema.sql` 是完整目标架构设计,不应直接挂载为当前运行库初始化脚本,否则会与当前后端代码的运行表结构不兼容。
|
||||||
|
|
||||||
首次部署:
|
首次部署:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -100,6 +104,12 @@ cp .env.example .env
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
后端镜像构建过程中会执行依赖导入自检,确认 `fastapi`、`uvicorn`、`psycopg`、`sqlalchemy`、`redis` 等运行依赖已安装。构建后也可以手动检查:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm yg-ft-backend-api:latest python -c "import psycopg; print(psycopg.__version__)"
|
||||||
|
```
|
||||||
|
|
||||||
默认访问地址:
|
默认访问地址:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ RUN pip install --upgrade pip \
|
|||||||
&& pip install -r /tmp/requirements.txt \
|
&& pip install -r /tmp/requirements.txt \
|
||||||
&& rm -f /tmp/requirements.txt
|
&& rm -f /tmp/requirements.txt
|
||||||
|
|
||||||
|
RUN python -c "import fastapi, uvicorn, psycopg, sqlalchemy, redis, jwt, passlib, httpx, alembic; print('backend dependency check ok')"
|
||||||
|
|
||||||
RUN mkdir -p /opt/yg-ft/logs/backend /data/yg-ft \
|
RUN mkdir -p /opt/yg-ft/logs/backend /data/yg-ft \
|
||||||
&& chmod -R 0775 /opt/yg-ft /data/yg-ft
|
&& chmod -R 0775 /opt/yg-ft /data/yg-ft
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ services:
|
|||||||
PGDATA: /var/lib/postgresql/data/pgdata
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
- ../../docs/postgres-schema.sql:/docker-entrypoint-initdb.d/001-schema.sql:ro
|
- ../../backend/app/db/sql/001_platform_runtime.sql:/docker-entrypoint-initdb.d/001-platform-runtime.sql:ro
|
||||||
ports:
|
ports:
|
||||||
- "${POSTGRES_PORT:-15432}:5432"
|
- "${POSTGRES_PORT:-15432}:5432"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ CUDA_VISIBLE_DEVICES=0,1,2,3
|
|||||||
|
|
||||||
## 10. 部署检查清单
|
## 10. 部署检查清单
|
||||||
|
|
||||||
- PostgreSQL 已初始化 `docs/postgres-schema.sql`。
|
- PostgreSQL 已初始化当前运行脚本 `backend/app/db/sql/001_platform_runtime.sql`;`docs/postgres-schema.sql` 作为目标架构设计,后续通过迁移体系逐步收敛。
|
||||||
- Redis 可连通。
|
- Redis 可连通。
|
||||||
- 后端 `GET /modelTF/health` 正常。
|
- 后端 `GET /modelTF/health` 正常。
|
||||||
- Compute API 健康检查正常。
|
- Compute API 健康检查正常。
|
||||||
|
|||||||
Reference in New Issue
Block a user