summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: 4f59a698b6a6b50df1f868fdec2b139f85214cbc (plain)
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
version: '2'

services:

### Applications Code Container #############################

    applications:
        image: tianon/true
        volumes:
            # as long as all the Vainglory repo are checked out on the same level this will work just fine 
            # volume to map Vainsocial.com code. used by Workspace repo.
            - ../vainsocial/:/var/www/vainsocial

    backend:
      image: tianon/true
      depends_on:
        - queue
        - db-web
        # - db-brawl
        - db-tournament
        - bridge
        - processor
        # - processor_brawl
        - processor_tournament
        - shrinker
        - shrinker_brawl
        - shrinker_tournament
        - apigrabber
        # - apigrabber_brawl
        - apigrabber_tournament
        - cruncher_global
        - cruncher_player
        - cruncher_global_tournament
        - telesucker
        - telesucker_tournament
        - analyzer
        # - analyzer_tournament

    backend_light:
      image: tianon/true
      depends_on:
        - queue
        - db-web
        - db-brawl
        - db-tournament
        - bridge
        - processor
        - shrinker
        - apigrabber
        - cruncher_global
        - cruncher_player
        - telesucker

    frontend:
      image: tianon/true
      depends_on:
        - nginx
        - queue
        - php-fpm
        - db-web
        - phpmyadmin

### Workspace Utilities Container ###########################

    workspace:
        container_name: workspace
        build:
            context: ./workspace
            args:
                - INSTALL_XDEBUG=true
                - INSTALL_NODE=false  # required is node is not installed locally
                - INSTALL_YARN=false  
                - INSTALL_V8JS_EXTENSION=false
                - COMPOSER_GLOBAL_INSTALL=true  # required if composer is not installed locally
                - INSTALL_WORKSPACE_SSH=true
                - INSTALL_LARAVEL_ENVOY=false
                - INSTALL_DEPLOYER=false
                - PUID=1000
                - PGID=1000
                - NODE_VERSION=stable
                - YARN_VERSION=latest
                - TZ=UTC
        volumes_from:
            - applications
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
            - "dockerhost:10.0.75.1"
              #links:
              #- db-web
              #- db-brawl
              #- db-tournament
        ports:
           - "2222:22"
        tty: true

### PHP-FPM Container #######################################

    php-fpm:
        container_name: php-fpm
        build:
            context: ./php-fpm
            args:
                - INSTALL_XDEBUG=true
                - INSTALL_SOAP=false
                - INSTALL_MONGO=false
                - INSTALL_ZIP_ARCHIVE=false
                - INSTALL_BCMATH=false
                - INSTALL_PHPREDIS=true
                - INSTALL_MEMCACHED=false
                - INSTALL_OPCACHE=false
                - INSTALL_EXIF=false
            dockerfile: Dockerfile-70
        volumes_from:
            - applications
              #- db-web
        expose:
            - "9000"
        links:
            - workspace
              #- db-web
              #- db-brawl
              #- db-tournament
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
            - "dockerhost:10.0.75.1"
        environment:
            # IMPORTANT: Set the Remote Interpreter entry matching name to `laravel`
            - PHP_IDE_CONFIG=serverName=laravel

    nginx:
        build:
            context: ./nginx
            args:
                - PHP_UPSTREAM=php-fpm
        volumes_from:
            - applications
        volumes:
            - ./logs/nginx/:/var/log/nginx
            - ./nginx/sites/:/etc/nginx/sites-available
        links:
            - workspace
            - php-fpm
              #- queue
              #- bridge
              #- db-web
              #- db-brawl
              #- db-tournament
        ports:
            - "80:80"
            - "443:443"

    bridge:
      build: ../bridge
      stop_signal: SIGINT
      restart: on-failure
      ports:
        - "8880:8880"
      volumes:
        - ../bridge:/usr/src/app
        - ../orm:/usr/src/orm
      depends_on:
        - queue
      environment:
        - RABBITMQ_URI=amqp://bridge:bridge@queue/
        - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
        - DATABASE_BRAWL_URI=mysql://vainbrawl:vainbrawl@db-brawl/vainbrawl
        - DATABASE_TOURNAMENT_URI=mysql://vaintournament:vaintournament@db-tournament/vaintournament
        - REGIONS=na,eu,sg,sa,ea
        - REGULAR_MODES=casual,ranked,casual_aral,blitz_pvp_ranked  # TODO!
        - BRAWL_MODES=casual_aral,blitz_pvp_ranked
        - TOURNAMENT_MODES=private,private_party_draft_match
        - ANALYZE_MODES=casual,ranked
        - TOURNAMENT_REGIONS=tournament-na,tournament-eu,tournament-sg,tournament-sa,tournament-ea
        - BRAWL_RETENTION_DAYS=7
        - PLAYER_PROCESS_QUEUE=process
        - GRAB_QUEUE=grab
        - GRAB_BRAWL_QUEUE=grab_brawl
        - GRAB_TOURNAMENT_QUEUE=grab_tournament
        - CRUNCH_QUEUE=crunch
        - CRUNCH_TOURNAMENT_QUEUE=crunch_tournament
        - SAMPLE_QUEUE=telesuck
        - SAMPLE_TOURNAMENT_QUEUE=telesuck
        - SHOVEL_SIZE=50000
        - ANALYZE_QUEUE=analyze
        - ANALYZE_TOURNAMENT_QUEUE=analyze_tournament
      env_file:
        - local.env

    apigrabber:
        build: ../apigrabber
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../apigrabber:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://apigrabber:apigrabber@queue/
          - QUEUE=grab
          - PROCESS_QUEUE=process
          - SAMPLE_QUEUE=telesuck
        env_file:
          - local.env

    apigrabber_brawl:
        build: ../apigrabber
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../apigrabber:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://apigrabber:apigrabber@queue/
          - QUEUE=grab_brawl
          - PROCESS_QUEUE=process_brawl
          - SAMPLE_QUEUE=telesuck
        env_file:
          - local.env

    apigrabber_tournament:
        build: ../apigrabber
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../apigrabber:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://apigrabber:apigrabber@queue/
          - QUEUE=grab_tournament
          - PROCESS_QUEUE=process_tournament
          - SAMPLE_QUEUE=telesuck
        env_file:
          - local.env

    telesucker:
        build: ../telesucker
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../telesucker:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://telesucker:telesucker@queue/
          - QUEUE=telesuck
          - PROCESS_QUEUE=shrink
          - SAMPLERS=5
        env_file:
          - local.env

    telesucker_tournament:
        build: ../telesucker
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../telesucker:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://telesucker:telesucker@queue/
          - QUEUE=telesuck_tournament
          - PROCESS_QUEUE=shrink_tournament
          - SAMPLERS=5
        env_file:
          - local.env

    processor:
        build: ../processor
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../processor:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://processor:processor@queue/
          - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
          - QUEUE=process
          - DOANALYZEMATCH=true
          - ANALYZE_QUEUE=analyze

    processor_brawl:
        build: ../processor
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../processor:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
          - db-brawl
        environment:
          - RABBITMQ_URI=amqp://processor:processor@queue/
          - DATABASE_URI=mysql://vainbrawl:vainbrawl@db-brawl/vainbrawl
          - QUEUE=process_brawl

    processor_tournament:
        build: ../processor
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../processor:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
          - db-tournament
        environment:
          - RABBITMQ_URI=amqp://processor:processor@queue/
          - DATABASE_URI=mysql://vaintournament:vaintournament@db-tournament/vaintournament
          - QUEUE=process_tournament

    shrinker:
        build: ../shrinker
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../shrinker:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://shrinker:shrinker@queue/
          - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
          - QUEUE=shrink
          - DOREAPMATCH=true
          - REAP_QUEUE=reap
          - BATCHSIZE=20
          - CHUNKSIZE=20
          - MAXCONNS=3

    shrinker_brawl:
        build: ../shrinker
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../shrinker:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
          - db-brawl
        environment:
          - RABBITMQ_URI=amqp://shrinker:shrinker@queue/
          - DATABASE_URI=mysql://vainbrawl:vainbrawl@db-brawl/vainbrawl
          - QUEUE=process_brawl

    shrinker_tournament:
        build: ../shrinker
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../shrinker:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
          - db-tournament
        environment:
          - RABBITMQ_URI=amqp://shrinker:shrinker@queue/
          - DATABASE_URI=mysql://vaintournament:vaintournament@db-tournament/vaintournament
          - QUEUE=shrink_tournament

    reaper:
        build: ../reaper
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../reaper:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://reaper:reaper@queue/
          - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
          - ELASTICSEARCH_URI=http://192.168.2.35:9200/
          - QUEUE=reap
          - MAXCONNS=3
          - BATCHSIZE=30
          - IDLE_TIMEOUT=1000

    cruncher_global:
        build: ../cruncher
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../cruncher:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://cruncher:cruncher@queue/
          - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
          - QUEUE=crunch_global
          - SCRIPT=crunch_global.sql
          - BATCHSIZE=20
          - SLOWMODE=0

    cruncher_player:
        build: ../cruncher
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../cruncher:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
        environment:
          - RABBITMQ_URI=amqp://cruncher:cruncher@queue/
          - DATABASE_URI=mysql://vain:vain@192.168.2.35/vainweb
          - QUEUE=crunch_player
          - SCRIPT=crunch_player.sql
          - BATCHSIZE=20
          - SLOWMODE=0

    cruncher_global_tournament:
        build: ../cruncher
        stop_signal: SIGINT
        restart: on-failure
        volumes:
          - ../cruncher:/usr/src/app
          - ../orm:/usr/src/orm
        depends_on:
          - queue
            #- db-web
        environment:
          - RABBITMQ_URI=amqp://cruncher:cruncher@queue/
          - DATABASE_URI=mysql://vaintournament:vaintournament@db-tournament/vaintournament
          - QUEUE=crunch_tournament

    analyzer:
      build: ../analyzer
      restart: on-failure
      volumes:
          - ../analyzer:/usr/src/app
      depends_on:
          - queue
      environment:
          - RABBITMQ_URI=amqp://analyzer:analyzer@queue/
          - DATABASE_URI=mysql+cymysql://vain:vain@192.168.2.35/vainweb
          - BATCHSIZE=30
          - CHUNKSIZE=10
          - QUEUE=analyze
          - DOCRUNCHMATCH=true
          - CRUNCH_PLAYER_QUEUE=crunch_player
          - DOTELESUCKMATCH=true
          - TELESUCK_QUEUE=telesuck

    analyzer_tournament:
      build: ../analyzer
      restart: on-failure
      volumes:
          - ../analyzer:/usr/src/app
      depends_on:
          - queue
          - db-tournament
      environment:
          - RABBITMQ_URI=amqp://analyzer:analyzer@queue/
          - DATABASE_URI=mysql+cymysql://vaintournament:vaintournament@db-tournament/vaintournament
          - QUEUE=analyze_tournament
          - BATCHSIZE=500
          - CHUNKSIZE=100

    db-web:
      image: mariadb:10
      volumes:
        - db-web-data:/var/lib/mysql
      ports:
        - "3306:3306"
      volumes:
        - ./mariadb:/etc/mysql/conf.d
      environment:
        MYSQL_DATABASE: vainweb
        MYSQL_USER: vainweb
        MYSQL_PASSWORD: vainweb
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

    db-brawl:
      image: mariadb:10
      volumes:
        - db-brawl-data:/var/lib/mysql
      ports:
        - "3307:3306"
      environment:
        MYSQL_DATABASE: vainbrawl
        MYSQL_USER: vainbrawl
        MYSQL_PASSWORD: vainbrawl
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

    db-tournament:
      image: mariadb:10
      volumes:
        - db-tournament-data:/var/lib/mysql
      ports:
        - "3308:3306"
      environment:
        MYSQL_DATABASE: vaintournament
        MYSQL_USER: vaintournament
        MYSQL_PASSWORD: vaintournament
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

    phpmyadmin:
      image: phpmyadmin/phpmyadmin:edge-4.7
      environment:
        - PMA_ARBITRARY=1
      ports:
        - "8882:80"
      volumes:
        - /sessions

    queue:
        build: ./rabbitmq
        hostname: queue
        volumes:
          - queue-data:/var/lib/queue
        ports:
          - "4369:4369"
          - "5671:5671"
          - "5672:5672"
          - "25672:25672"
          - "15674:15674"  # web-stomp
          - "8881:15672"  # management guest/guest
        environment:
          - RABBITMQ_HIPE_COMPILE=1
#          - RABBITMQ_RECREATE_ON_STARTUP=true  # for debugging

volumes:
    db-web-data:
        driver: "local"
    db-brawl-data:
        driver: "local"
    db-tournament-data:
        driver: "local"
    queue-data:
        driver: "local"
    sessions:    ## nothing is connected to this (- ./data/sessions:/sessions)
       driver: "local"