-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
docker-compose.yml
77 lines (75 loc) · 1.86 KB
/
docker-compose.yml
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
version: '3'
services:
cockroachdb:
image: cockroachdb/cockroach:latest-v23.1
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
restart: "no"
volumes:
- data:/var/lib/cockroach
expose:
- "8080"
- "26257"
ports:
- "26257:26257"
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
interval: 3s
timeout: 3s
retries: 5
nakama:
image: registry.heroiclabs.com/heroiclabs/nakama:3.22.0
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --logger.level DEBUG --session.token_expiry_sec 7200 --metrics.prometheus_port 9100
restart: "no"
links:
- "cockroachdb:db"
depends_on:
cockroachdb:
condition: service_healthy
prometheus:
condition: service_started
volumes:
- ./:/nakama/data
expose:
- "7349"
- "7350"
- "7351"
- "9100"
ports:
- "7349:7349"
- "7350:7350"
- "7351:7351"
healthcheck:
test: ["CMD", "/nakama/nakama", "healthcheck"]
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus
entrypoint: /bin/sh -c
command: |
'sh -s <<EOF
cat > ./prometheus.yml <<EON
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: nakama
metrics_path: /
static_configs:
- targets: ['nakama:9100']
EON
prometheus --config.file=./prometheus.yml
EOF'
ports:
- '9090:9090'
volumes:
data: