-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.docker-compose.yml
175 lines (172 loc) · 4.77 KB
/
example.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: '3'
services:
nakama:
image: echotools/echonakama-nakama:latest
build: .
restart: "unless-stopped"
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
exec /nakama/nakama
--name nakama1 --database.address root@cockroachdb:26257
--session.token_expiry_sec 7200
--metrics.prometheus_port 9100
--logger.file /logs/nakama.log
--logger.level DEBUG
--config /nakama/data/local.yml
volumes:
- ./local.yml:/nakama/data/local.yml
- ./logs:/logs
links:
- "cockroachdb:db"
depends_on:
cockroachdb:
condition: service_healthy
prometheus:
condition: service_started
expose:
- "7349"
- "7350"
- "7351"
- "9100"
# remove if using nginx as reverse proxy
ports:
- "7349:7349"
- "7350:7350"
- "7351:7351"
healthcheck:
test: ["CMD", "/nakama/nakama", "healthcheck"]
interval: 10s
timeout: 5s
retries: 5
echorelay:
build: EchoRelay
image: echotools/echonakama-echorelay:latest
restart: "unless-stopped"
entrypoint:
- "/bin/sh"
- "-ecx"
- >
exec dotnet EchoRelay.Cli.dll
--port 6789
--nakama-uri "http://nakama:7350/?server_key=devonly_nakama_server_key&relay_id=dev-echorelay"
--apikey devonly_echorelay_api_key
--enable-api
--statsinterval 30000
--verbose
--logfile /logs/echorelay.log
volumes:
- ./logs:/logs
expose:
- "6789"
# remove if using nginx as reverse proxy
ports:
- "7777:6789"
- "6789:6789"
links:
- nakama
depends_on:
nakama:
condition: service_started
cockroachdb:
image: cockroachdb/cockroach:latest-v23.1
restart: "unless-stopped"
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
volumes:
- data:/var/lib/cockroach
expose:
- "8080"
- "26257"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
interval: 3s
timeout: 3s
retries: 5
prometheus:
image: prom/prometheus
restart: "unless-stopped"
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'
nginx:
# remove this to have nginx come up automatically.
# remove ports from other services too (check rest of file)
profiles:
- prod
image: jonasal/nginx-certbot:latest
restart: "unless-stopped"
environment:
# This will depend on your authenticator method.
# see https://github.com/JonasAlfredsson/docker-nginx-certbot
CERTBOT_EMAIL: "[email protected]"
#CERTBOT_AUTHENTICATOR: "dns-cloudflare"
ports:
# echorelay and webapp
- "80:80"
- "443:443"
# echorelay single port
- "6789:6789"
# nakama grpc
- "7349:7349"
# nakama http api
- "7350:7350"
# nakama admin console
- "7351:7351"
# echorelay "no path" port based
- "31112:31112"
- "34712:34712"
- "42148:42148"
- "42850:42850"
volumes:
- ./nginx_secrets:/etc/letsencrypt
- ./nginx_conf.d:/etc/nginx/user_conf.d
# the redirector will interfere with echorelay
- ./nginx_conf.d/redirector.conf:/etc/nginx/conf.d/redirector.conf
links:
- nakama
depends_on:
nakama:
condition: service_started
webapp:
image: echotools/echonakama-webapp:latest
build:
context: ./webapp
restart: "unless-stopped"
environment:
- "NODE_ENV=production"
- "LINK_PAGE_URL=http://localhost:3000/link"
- "SESSION_SECRET=nakama_dev_session_secret"
- "DISCORD_AUTHORIZE_URL=https://discord.com/api/oauth2/authorize?client_id=1180461747488956496&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fsignin-discord&scope=identify"
- "NAKAMA_API_BASE_URL=http://nakama:7350"
- "NAKAMA_HTTP_KEY=devonly_nakama_server_key"
- "DISCORD_REDIRECT_URI=http://localhost:3000/signin-discord"
- "SUCCESS_REDIRECT_URL=https://discord.gg/echo-combat-lounge-779349159852769310"
expose:
- "8080"
# remove if using nginx reverse proxy
ports:
- "3000:8080"
links:
- nakama
depends_on:
nakama:
condition: service_started
volumes:
data: