-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
226 lines (220 loc) · 7.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
226 lines (220 loc) · 7.34 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
version: '3.4'
x-php-container-volumes:
&php-container-volumes
volumes:
- ./:/project:delegated
- php-vendor:/project/vendor
- asset-vendor:/project/assets/vendor
- proxysql.sock:/var/run/proxysql
- type: tmpfs
target: /project/var
x-php-container:
&php-container
<<: *php-container-volumes
build:
context: .
dockerfile: ./docker/Dockerfile
env_file: ./.env
depends_on:
- mysql
- proxysql
- redis
- rabbitmq
- nchan
restart: on-failure
services:
##############################
# Database and application #
##############################
traefik:
image: traefik:3.6
command:
- --metrics.prometheus=true
- --providers.docker
- --providers.docker.exposedByDefault=false
- --entrypoints.http.address=:80
- --entrypoints.http.http.redirections.entrypoint.to=https
- --entrypoints.http.http.redirections.entrypoint.scheme=https
- --entrypoints.http.http.redirections.entrypoint.permanent=true
- --entrypoints.https.address=:443
- --entrypoints.https.http.tls=true
ports:
- { published: 80, target: 80, mode: host }
- { published: 443, target: 443, mode: host }
depends_on:
- nchan
- php-fpm
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "prometheus-job=traefik"
- "prometheus-port=8080"
grafana:
image: ghcr.io/gaming-platform/docker-grafana:12.2
ports:
- "8083:3000"
prometheus:
image: ghcr.io/gaming-platform/docker-prometheus:3.7
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.entrypoints=https"
- "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"
php-fpm:
<<: *php-container
labels:
- "traefik.enable=true"
- "traefik.http.routers.php-fpm.entrypoints=https"
- "traefik.http.routers.php-fpm.priority=10"
- "traefik.http.routers.php-fpm.rule=PathPrefix(`/`)"
- "traefik.http.services.php-fpm.loadbalancer.server.port=80"
- "prometheus-job=php-fpm"
##############################
# Long running processes #
##############################
php-connect-four-follow-event-store:
<<: *php-container
command: bin/restartOnChange bin/console connect-four:follow-event-store pointer all
labels:
- "prometheus-job=connect-four-follow-event-store"
php-connect-four-publish-running-games-count-to-nchan:
<<: *php-container
command: bin/restartOnChange bin/console connect-four:publish-running-games-count-to-nchan
php-connect-four-handle-timeouts:
<<: *php-container
command: bin/restartOnChange bin/console connect-four:handle-timeouts
labels:
- "prometheus-job=connect-four-handle-timeouts"
php-chat-follow-event-store:
<<: *php-container
command: bin/restartOnChange bin/console chat:follow-event-store pointer all
labels:
- "prometheus-job=chat-follow-event-store"
php-identity-follow-event-store:
<<: *php-container
command: bin/restartOnChange bin/console identity:follow-event-store pointer all
labels:
- "prometheus-job=identity-follow-event-store"
php-consume-messages:
<<: *php-container
command: bin/restartOnChange bin/console gaming:consume-messages all
labels:
- "prometheus-job=consume-messages"
##############################
# Development helper #
##############################
php:
<<: *php-container-volumes
build:
context: .
dockerfile: ./docker/Dockerfile
entrypoint: ''
command: 'true'
env_file: ./.env
phpmyadmin:
image: phpmyadmin/phpmyadmin:5.2
environment:
PMA_HOST: mysql
PMA_USER: root
PMA_PASSWORD: password
ports:
- "8081:80"
depends_on:
- mysql
phpredisadmin:
image: erikdubbelboer/phpredisadmin:1
environment:
REDIS_1_HOST: redis
ports:
- "8082:80"
depends_on:
- redis
volumes:
asset-vendor:
php-vendor:
mysql:
proxysql.sock:
redis:
rabbitmq:
prometheus: