Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (86 loc) · 2.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (86 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
services:
# ── 默认档:MongoDB(双主线之一)── `docker compose up` 即用
# 示例配置按三档定档默认零依赖 Sqlite(quickstart 载体);容器内挂载 Mongo 档样例选型:
# 容器内经服务名互访(Configs/compose/ 下专用配置指向 mongo:27017,宿主机样例保留 127.0.0.1)。
mongo:
image: mongo:8.2
container_name: gfx-mongo
restart: unless-stopped
ports:
- "127.0.0.1:37017:27017"
volumes:
- mongo-data:/data/db
healthcheck:
test: [ "CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 }).ok" ]
interval: 5s
timeout: 3s
retries: 20
networks:
- gameframex
# 单一镜像;启动参数经 GAMEFRAMEX_SERVER_ARGS 原样透传(单进程承载当前所有业务模块)。
# 数据库选型经挂载的 Configs/app_config.json 表达(启动期校验器要求 CLI 与文件一致,文件即选型载体)。
# 管理 API(28090)无 HTTP 签名验证,仅绑定宿主机回环地址,不对局域网发布。
game:
build:
context: .
image: gameframex-server:local
container_name: gfx-game
depends_on:
mongo:
condition: service_healthy
volumes:
- "./Configs/compose/app_config.mongo.json:/app/Configs/app_config.json:ro"
- "./running/game/logs:/app/data/logs"
ports:
- "39100:29100"
- "38080:28080"
- "127.0.0.1:28090:28090"
networks:
- gameframex
# ── PostgreSQL 档(双主线之二):`docker compose --profile postgres up` 启用 ──
# 与 Mongo 档并列的完整 Provider 示例;两档不共享数据,切换 Provider 不迁移存量数据(无迁移工具,见 README)。
postgres:
image: postgres:17
container_name: gfx-postgres
restart: unless-stopped
profiles:
- postgres
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: gameframex
ports:
- "127.0.0.1:35432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 3s
retries: 20
networks:
- gameframex
game-postgres:
build:
context: .
image: gameframex-server:local
container_name: gfx-game-postgres
profiles:
- postgres
depends_on:
postgres:
condition: service_healthy
volumes:
- "./Configs/compose/app_config.postgres.json:/app/Configs/app_config.json:ro"
- "./running/game-postgres/logs:/app/data/logs"
ports:
- "39200:29100"
- "38081:28080"
- "127.0.0.1:28091:28090"
networks:
- gameframex
networks:
gameframex:
driver: bridge
volumes:
mongo-data:
postgres-data: