-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
executable file
·184 lines (145 loc) · 4.25 KB
/
docker-compose.prod.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
176
177
178
179
180
181
182
183
version: '3'
services:
supertokens-db:
hostname: supertokens-db
image: mysql:8.3
environment:
MYSQL_ROOT_PASSWORD: ${SUPERTOKENS_DB_PASS}
MYSQL_USER: ${SUPERTOKENS_DB_USER}
MYSQL_PASSWORD: ${SUPERTOKENS_DB_PASS}
MYSQL_DATABASE: supertokens
networks:
- game_node_app
restart: always
volumes:
- supertokens-db:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
supertokens:
hostname: supertokens
image: registry.supertokens.io/supertokens/supertokens-mysql:9.1.1
depends_on:
- supertokens-db
environment:
MYSQL_CONNECTION_URI: mysql://${SUPERTOKENS_DB_USER}:${SUPERTOKENS_DB_PASS}@supertokens-db:3306/supertokens
networks:
- game_node_app
restart: always
deploy:
replicas: 1
healthcheck:
test: >
bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3.13-management
hostname: rabbitmq
volumes:
- rabbitmq:/var/lib/rabbitmq/
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
restart: always
deploy:
replicas: 1
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
networks:
- game_node_app
db:
image: mysql:8.3
hostname: server-db
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASS}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
MYSQL_DATABASE: gamenode
MYSQL_ROOT_HOST: '%'
networks:
- game_node_app
restart: always
volumes:
- db:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "--password=${DB_USER}"]
timeout: 20s
retries: 10
redis:
image: redis:latest
hostname: server-redis
command: ["redis-server", "--appendonly", "no", "--maxmemory", "4096mb", "--maxmemory-policy", "allkeys-lru"]
environment:
ALLOW_EMPTY_PASSWORD: 'yes'
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
deploy:
replicas: 1
volumes:
- redis:/var/lib/redis
networks:
- game_node_app
server:
image: lamarcke/game-node-server:latest
hostname: server
# Most of the env vars are loaded directly from .env, we only need to override some to make sure
# the docker resources are accessible.
environment:
REDIS_URL: redis://server-redis:6379
SUPERTOKENS_CORE_URI: http://@supertokens:3567
SERVER_PORT: 5000
DOMAIN_API: https://server.gamenode.app
DOMAIN_WEBSITE: https://gamenode.app
DB_HOST: server-db
DB_DATABASE: gamenode
DB_PASS: ${DB_PASS}
DB_USER: ${DB_USER}
DB_PORT: 3306
RABBITMQ_URI: amqp://${RABBITMQ_USERNAME}:${RABBITMQ_PASSWORD}@rabbitmq:5672
EMAIL_HOST: ${EMAIL_HOST}
EMAIL_PORT: ${EMAIL_PORT}
EMAIL_USERNAME: ${EMAIL_USERNAME}
EMAIL_PASSWORD: ${EMAIL_PASSWORD}
EMAIL_FROM: ${EMAIL_FROM}
PROVIDER_GOOGLE_CLIENT_ID: ${PROVIDER_GOOGLE_CLIENT_ID}
PROVIDER_GOOGLE_CLIENT_SECRET: ${PROVIDER_GOOGLE_CLIENT_SECRET}
PROVIDER_DISCORD_CLIENT_ID: ${PROVIDER_DISCORD_CLIENT_ID}
PROVIDER_DISCORD_CLIENT_SECRET: ${PROVIDER_DISCORD_CLIENT_SECRET}
PROVIDER_TWITTER_CLIENT_ID: ${PROVIDER_TWITTER_CLIENT_ID}
PROVIDER_TWITTER_CLIENT_SECRET: ${PROVIDER_TWITTER_CLIENT_SECRET}
STEAM_API_KEY: ${STEAM_API_KEY}
TWITCH_CLIENT_ID: ${TWITCH_CLIENT_ID}
TWITCH_CLIENT_SECRET: ${TWITCH_CLIENT_SECRET}
PSN_NPSSO_KEY: ${PSN_NPSSO_KEY}
healthcheck:
test: [ "CMD-SHELL", "yarn run healthcheck" ]
interval: 30s
timeout: 10s
retries: 3
restart: always
deploy:
replicas: 2
command: "yarn start:prod"
volumes:
- gamenode:/app/public/uploads
networks:
- game_node_app
- game_node_app_public
networks:
game_node_app:
external: true
game_node_app_public:
external: true
volumes:
redis:
db:
gamenode:
supertokens-db:
rabbitmq: