-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdocker-compose.yml
171 lines (167 loc) · 6.25 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
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
version: '3.4'
# This file must be self-contained because it is used by Play with Docker.
x-php-container:
&php-container
image: marein/php-gaming-website:php-fpm
environment:
APP_ENV: "prod"
APP_KERNEL_SECRET: "ThisTokenIsNotSoSecretChangeIt"
APP_WAIT_FOR: "unix:///var/run/proxysql/proxysql.sock,mysql:3306,redis:6379,rabbitmq:5672,nchan:81"
APP_RUN_MIGRATIONS: "1"
APP_RABBIT_MQ_DSN: "amqp://guest:guest@rabbitmq:5672?heartbeat=60&prefetchCount=30"
APP_CHAT_DOCTRINE_DBAL_URL: "mysqli://root:password@localhost/chat?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock"
APP_CHAT_PREDIS_CLIENT_URL: "redis://redis:6379?persistent=1"
APP_CONNECT_FOUR_DOCTRINE_DBAL_URL: "mysqli://root:password@localhost/%env(APP_CONNECT_FOUR_DOCTRINE_DBAL_DATABASE)%?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock"
APP_CONNECT_FOUR_DOCTRINE_DBAL_DATABASE: "connect-four"
APP_CONNECT_FOUR_DOCTRINE_DBAL_SHARDS: "connect-four"
APP_CONNECT_FOUR_PREDIS_CLIENT_URL: "redis://redis:6379?persistent=1"
APP_IDENTITY_DOCTRINE_DBAL_URL: "mysqli://root:password@localhost/identity?persistent=1&unix_socket=/var/run/proxysql/proxysql.sock"
APP_WEB_INTERFACE_PREDIS_CLIENT_URL: "redis://redis:6379?persistent=1"
APP_WEB_INTERFACE_NCHAN_BASE_URL: "http://nchan:81"
APP_WEB_INTERFACE_PUBLISH_TO_BROWSER_SHARDS: "1"
depends_on:
- mysql
- proxysql
- redis
- rabbitmq
- nchan
volumes:
- proxysql.sock:/var/run/proxysql
restart: on-failure
services:
traefik:
image: traefik:2.10
command:
- --metrics.prometheus=true
- --providers.docker
- --providers.docker.exposedbydefault=false
ports:
- "80:80"
depends_on:
- nchan
- web-interface-http
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "prometheus-job=traefik"
- "prometheus-port=8080"
grafana:
image: ghcr.io/gaming-platform/docker-grafana:10.0
restart: on-failure
ports:
- "8083:3000"
prometheus:
image: ghcr.io/gaming-platform/docker-prometheus:2.45
command: --config.file=/etc/prometheus/docker.yml
volumes:
- prometheus:/prometheus
- /var/run/docker.sock:/var/run/docker.sock
restart: on-failure
node-exporter:
image: prom/node-exporter:v1.6.0
labels:
- "prometheus-job=node"
- "prometheus-port=9100"
mysql:
image: ghcr.io/gaming-platform/docker-mysql:8.2
volumes:
- mysql:/var/lib/mysql
restart: on-failure
mysql-exporter:
image: prom/mysqld-exporter:v0.15.0
command: --mysqld.username=root --mysqld.address mysql:3306
environment:
MYSQLD_EXPORTER_PASSWORD: password
labels:
- "prometheus-job=mysql"
- "prometheus-port=9104"
proxysql:
image: ghcr.io/gaming-platform/docker-proxysql:2.5
environment:
PROXYSQL_CONFIG: |
admin_variables: {
restapi_enabled="true"
hash_passwords="false"
}
mysql_variables: {
interfaces="/var/run/proxysql/proxysql.sock"
server_version="8.2"
monitor_username="root"
monitor_password="password"
auto_increment_delay_multiplex=0
}
mysql_servers: (
{hostgroup=1,address="mysql",port=3306,max_connections=100}
)
mysql_users: (
{username="root",password="password",default_hostgroup=1}
)
depends_on:
- mysql
volumes:
- proxysql.sock:/var/run/proxysql
labels:
- "prometheus-job=proxysql"
- "prometheus-port=6070"
restart: on-failure
redis:
image: ghcr.io/gaming-platform/docker-redis:7.2
volumes:
- redis:/data
restart: on-failure
redis-exporter:
image: oliver006/redis_exporter:v1.51.0
command:
- '-redis.addr=redis:6379'
labels:
- "prometheus-job=redis"
- "prometheus-port=9121"
rabbitmq:
image: ghcr.io/gaming-platform/docker-rabbitmq:3.12
hostname: rabbitmq
volumes:
- rabbitmq:/var/lib/rabbitmq/mnesia
labels:
- "prometheus-job=rabbitmq"
- "prometheus-port=15692"
- "prometheus-path=/metrics/per-object"
restart: on-failure
nchan:
image: ghcr.io/gaming-platform/docker-nchan:1.3
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.nchan.priority=20"
- "traefik.http.routers.nchan.rule=PathPrefix(`/sse`)"
- "traefik.http.routers.nchan.middlewares=nchan-stripprefix"
- "traefik.http.middlewares.nchan-stripprefix.stripprefix.prefixes=/sse"
- "prometheus-job=nchan"
- "prometheus-port=81"
web-interface-http:
<<: *php-container
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-interface-http.priority=10"
- "traefik.http.routers.web-interface-http.rule=PathPrefix(`/`)"
- "traefik.http.services.web-interface-http.loadbalancer.server.port=80"
connect-four-follow-event-store:
<<: *php-container
command: bin/console connect-four:follow-event-store pointer all
chat-follow-event-store:
<<: *php-container
command: bin/console chat:follow-event-store pointer all
identity-follow-event-store:
<<: *php-container
command: bin/console identity:follow-event-store pointer all
consume-messages:
<<: *php-container
command: bin/console gaming:consume-messages all
web-interface-publish-running-games-count-to-nchan:
<<: *php-container
command: bin/console web-interface:publish-running-games-count-to-nchan
volumes:
mysql:
proxysql.sock:
redis:
rabbitmq:
prometheus: