-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
200 lines (184 loc) · 5.36 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
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
version: '2'
services:
logs:
image: "{{ project_name }}-logs:1.0.1"
container_name: {{ project_name }}-logs
build:
context: ./logs
dockerfile: Dockerfile
labels:
application: "{{ project_name }}-logs"
environment:
# for this container Logspout will ignore any log entries
LOGSPOUT: ignore
ES_HEAP_SIZE: "2g"
LS_HEAP_SIZE: "1g"
ES_CONNECT_RETRY: 100
ports:
- "5601:5601"
- "9200:9200"
- "5000:5000"
logs-logspout:
image: gliderlabs/logspout:v3.2.12
container_name: {{ project_name }}-logspout
labels:
application: "{{ project_name }}-logspout"
depends_on:
- logs
links:
- logs
environment:
DEBUG: "true"
# for this container Logspout will ignore any log entries
LOGSPOUT: ignore
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: syslog://logs:5000
web-logs:
image: alpine:3.8
container_name: "{{ project_name }}-web-logs"
labels:
application: "{{ project_name }}-web-logs"
volumes:
- /opt/{{ project_name }}/logs/web
command: /bin/true
docs:
container_name: "{{ project_name }}-docs"
image: "{{ project_name }}-docs:1.0.1"
build:
context: ./docs
dockerfile: Dockerfile-docs
labels:
application: "{{ project_name }}-docs"
command: make html
web:
env_file: ./{{ project_name }}-web/env
container_name: "{{ project_name }}-web"
image: "{{ project_name }}-web:1.0.1"
build:
context: ./{{ project_name }}-web
dockerfile: Dockerfile-web
labels:
application: "{{ project_name }}-web"
volumes:
- /opt/{{ project_name }}/static
volumes_from:
- web-logs
expose:
- "8000"
depends_on:
- db
- logs
- web-logs
db:
env_file: ./{{ project_name }}-web/env
image: "{{ project_name }}-db:1.0.1"
container_name: "{{ project_name }}-db"
build:
context: ./db
dockerfile: Dockerfile-db
labels:
application: "{{ project_name }}-db"
expose:
- "5432"
volumes_from:
- data
data:
image: "{{ project_name }}-data:1.0.1"
container_name: "{{ project_name }}-data"
labels:
application: "{{ project_name }}-data"
build:
context: ./db
dockerfile: Dockerfile-data
volumes:
- /var/lib/postgresql
command: /bin/true
https-logs:
image: alpine:3.8
container_name: "{{ project_name }}-https-logs"
labels:
application: "{{ project_name }}-https-logs"
volumes:
- /opt/{{ project_name }}/logs/https
command: /bin/true
https:
container_name: "{{ project_name }}-https"
image: "{{ project_name }}-https:1.0.1"
build:
context: ./https
dockerfile: Dockerfile-https
volumes_from:
- https-logs
ports:
- "80:80"
labels:
application: "{{ project_name }}-https"
depends_on:
- web
- https-logs
command: bash entry-point.sh
testing:
container_name: "{{ project_name }}-testing"
image: "{{ project_name }}-testing:1.0.1"
build:
context: ./testing
dockerfile: Dockerfile-testing
links:
- logs
command: tail -f /dev/null
perf:
container_name: "{{ project_name }}-perf"
image: "{{ project_name }}-perf:1.0.1"
build:
context: ./perf-testing
dockerfile: Dockerfile-perf
ports:
- "8089:8089"
links:
- web
command: locust -f locustfile.py --host=http://{{ project_name }}-web:8000
docker-console:
image: portainer/portainer:1.24.1
container_name: {{ project_name }}-docker-console
labels:
application: "{{ project_name }}-docker-console"
ports:
- "9000:9000"
# portainer will shut down without admin pass set, it is 'admin' password
command: -H unix:///var/run/docker.sock --admin-password='$$2y$$05$$HZbyaSOGIUoJmg4pOgJ/hOw66eiEP.iZdD5WpFIKJx4A0A22UEPvO'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
monitoring-agent:
container_name: "{{ project_name }}-monitoring-agent"
image: "{{ project_name }}-monitoring-agent:1.0.1"
build:
context: ./monitoring/glances
dockerfile: Dockerfile-glances
ports:
- 61208-61209:61208-61209
environment:
# OPTS for glances:v2.11.1
#GLANCES_OPT: "--export-statsd -q -t 1" #for exporting to statd standalone quite mode needs to be set
# OPTS for glances 3
GLANCES_OPT: "--export statsd -q -t 1" #for exporting to statd standalone quite mode needs to be set
#GLANCES_OPT: "-w" #for web console, no export to graphiteGLANCES_OPT: "--export-statsd -q -t 1" #for exporting to statd standalone quite mode needs to be set
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
pid: "host"
monitoring-server:
container_name: {{ project_name }}-monitoring-server
image: "{{ project_name }}-monitoring-server:1.0.1"
build:
context: ./monitoring/grafana
dockerfile: Dockerfile-grafana
ports:
- 81:81 #graphite web ui / rest api
- 88:80 #graphana web ui
- 2003-2004:2003-2004
- 2023-2024:2023-2024
- 8125:8125/udp #statsd udp receiver port
- 8126:8126
volumes:
portainer_data: