-
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathdocker-compose.server.yml
More file actions
110 lines (97 loc) · 3.02 KB
/
docker-compose.server.yml
File metadata and controls
110 lines (97 loc) · 3.02 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
services:
mx-core:
# CI build this image, then ship it to your SERVER.
# e.g. ghcr.io/<org>/<repo>:<tag>
image: ${MX_CORE_IMAGE:-mx-core:latest}
container_name: mx-core
restart: unless-stopped
ports:
- "${MX_PORT:-2333}:2333"
environment:
TZ: ${TZ:-Asia/Shanghai}
PORT: "2333"
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-localhost:*}
# PostgreSQL (container in this compose)
PG_HOST: postgres
PG_PORT: "5432"
PG_USER: ${PG_USER:-mx}
PG_PASSWORD: ${PG_PASSWORD:-mx}
PG_DATABASE: ${PG_DATABASE:-mx_core}
SNOWFLAKE_WORKER_ID: ${SNOWFLAKE_WORKER_ID:-1}
# Redis (container in this compose)
REDIS_HOST: redis
REDIS_PORT: "6379"
# REDIS_PASSWORD: ${REDIS_PASSWORD:-}
# Security (optional)
# ENCRYPT_KEY must be length 64 if ENCRYPT_ENABLE=true
ENCRYPT_ENABLE: ${ENCRYPT_ENABLE:-true}
ENCRYPT_KEY: ${ENCRYPT_KEY:-}
JWT_SECRET: ${JWT_SECRET:-}
JWT_EXPIRE: ${JWT_EXPIRE:-}
# Cache
DISABLE_CACHE: ${DISABLE_CACHE:-false}
# Debug (optional)
DEBUG: ${DEBUG:-false}
DEBUG_MEMORY_DUMP: ${DEBUG_MEMORY_DUMP:-false}
volumes:
# production data dir: ~/.mx-space
- ./data/mx-space:/root/.mx-space
depends_on:
mx-migrate:
condition: service_completed_successfully
redis:
condition: service_started
healthcheck:
test: [CMD, curl, -f, "http://127.0.0.1:2333/api/v2/ping"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
# One-shot release-phase migration runner. Applies any pending Drizzle
# migrations and exits 0; mx-core waits for completion via
# `service_completed_successfully` before starting. See
# docs/superpowers/specs/2026-05-05-database-migration-release-phase-design.md.
mx-migrate:
image: ${MX_CORE_IMAGE:-mx-core:latest}
container_name: mx-migrate
command: ["node", "migrate.mjs"]
restart: "no"
environment:
TZ: ${TZ:-Asia/Shanghai}
PG_HOST: postgres
PG_PORT: "5432"
PG_USER: ${PG_USER:-mx}
PG_PASSWORD: ${PG_PASSWORD:-mx}
PG_DATABASE: ${PG_DATABASE:-mx_core}
depends_on:
postgres:
condition: service_healthy
redis:
image: redis:8-alpine
container_name: mx-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./data/redis:/data
healthcheck:
test: [CMD-SHELL, "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
postgres:
image: postgres:16-alpine
container_name: mx-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${PG_USER:-mx}
POSTGRES_PASSWORD: ${PG_PASSWORD:-mx}
POSTGRES_DB: ${PG_DATABASE:-mx_core}
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PG_USER:-mx} -d ${PG_DATABASE:-mx_core}"]
interval: 30s
timeout: 5s
retries: 5
start_period: 10s