-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.yml
104 lines (95 loc) · 1.84 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
version: "2.4"
x-cs: &cs-common
build: .
image: checksystem:latest
cpu_shares: 1024
init: true
restart: unless-stopped
volumes:
- "./cs.conf:/app/cs.conf"
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_URI
- MOJO_CONFIG=/app/cs.conf
services:
cs-manager:
<<: *cs-common
depends_on:
- init
command:
- /bin/bash
- -xc
- >-
while true; do
perl script/cs check_db
if [[ $$? == 0 ]]; then break; fi
sleep 2
done &&
perl script/cs manager
cs-web:
<<: *cs-common
depends_on:
- init
ports:
- "80:8080"
command:
- /bin/bash
- -xc
- >-
while true; do
perl script/cs check_db
if [[ $$? == 0 ]]; then break; fi
sleep 2
done &&
hypnotoad -f script/cs
cs-workers:
<<: *cs-common
depends_on:
- init
scale: 4
command:
- /bin/bash
- -xc
- >-
while true; do
perl script/cs check_db
if [[ $$? == 0 ]]; then break; fi
sleep 2
done &&
perl script/cs minion worker -q default -q checker -j 64
init:
<<: *cs-common
restart: "no"
depends_on:
- pg
command:
- /bin/bash
- -xc
- >-
while true; do
perl script/cs check_db
if [[ $$? == 0 ]]; then break; fi
perl script/cs init_db
if [[ $$? == 0 ]]; then break; fi
sleep 2
done
pg:
image: postgres
cpu_shares: 1024
volumes:
- "cs_pg_data:/var/lib/postgresql/data"
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
command:
- -c
- shared_buffers=4GB
- -c
- work_mem=8MB
- -c
- max_connections=1024
volumes:
cs_pg_data: