-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (90 loc) · 2.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
95 lines (90 loc) · 2.43 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
92
93
94
95
# Shared env block — mx-migrate boots a full Nest context (it now runs the
# combined schema + app-data migration phases), so it must receive the same
# config the runtime app needs (Redis, snowflake worker id, jwt secret, …).
x-mx-env: &mx-env
TZ: Asia/Shanghai
NODE_ENV: production
REDIS_HOST: redis
PG_HOST: postgres
PG_PORT: "5432"
PG_USER: mx
PG_PASSWORD: mx
PG_DATABASE: mx_core
SNOWFLAKE_WORKER_ID: "1"
ALLOWED_ORIGINS: localhost
JWT_SECRET: YOUR_SUPER_SECURED_JWT_SECRET_STRING
services:
app:
container_name: mx-server
image: innei/mx-server:latest
environment: *mx-env
volumes:
- ./data/mx-space:/root/.mx-space
ports:
- '2333:2333'
depends_on:
mx-migrate:
condition: service_completed_successfully
redis:
condition: service_started
networks:
- mx-space
restart: unless-stopped
healthcheck:
test: [CMD, curl, -f, 'http://127.0.0.1:2333/api/v3/ping']
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
# One-shot release-phase migration runner. Runs schema migrations (drizzle)
# then app-data migrations (Nest-bootstrapped registry). Exits 0; the `app`
# service waits for completion via `service_completed_successfully` before
# starting. See docs/superpowers/specs/2026-05-05-database-migration-release-phase-design.md.
mx-migrate:
container_name: mx-migrate
image: innei/mx-server:latest
command: ['node', 'migrate.mjs']
environment: *mx-env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- mx-space
restart: 'no'
postgres:
container_name: postgres
image: postgres:16-alpine
environment:
- POSTGRES_USER=mx
- POSTGRES_PASSWORD=mx
- POSTGRES_DB=mx_core
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U mx -d mx_core']
interval: 30s
timeout: 5s
retries: 5
start_period: 10s
networks:
- mx-space
restart: unless-stopped
redis:
image: redis:alpine
container_name: redis
volumes:
- ./data/redis:/data
healthcheck:
test: [CMD-SHELL, 'redis-cli ping | grep PONG']
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
networks:
- mx-space
restart: unless-stopped
networks:
mx-space:
driver: bridge