forked from arikhativa/transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·197 lines (182 loc) · 3.96 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
version: '3.8'
networks:
transcendence:
driver: bridge
volumes:
postgres_data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/postgres_data
o: bind
prometheus_data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/prometheus_data
o: bind
grafana-data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/grafana_data
o: bind
elastic-data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/elastic_data
o: bind
common-log-data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/commonlog_data
o: bind
nginx-logs-data:
driver: local
driver_opts:
type: none
device: ${HOME}/data/nginx-logs-data
o: bind
services:
# Enrtypoint
nginx:
build: ./nginx
container_name: nginx
restart: "unless-stopped"
networks:
- transcendence
ports:
- 443:443
- 3000:3000
- 5601:5601
env_file:
- .env
volumes:
- nginx-logs-data:/var/log/nginx
# Backend
django:
container_name: django
restart: "unless-stopped"
build: ./django
networks:
- transcendence
depends_on:
- postgres
env_file:
- .env
volumes:
- common-log-data:/var/log/django/
# DB
postgres:
container_name: postgres
restart: "unless-stopped"
image: postgres:12-bullseye
networks:
- transcendence
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql/data
# Monitoring
prometheus:
container_name: prometheus
image: prom/prometheus:v2.47.2
restart: "unless-stopped"
networks:
- transcendence
volumes:
- ./prometheus:/etc/prometheus:ro
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.size=100MB"
- "--storage.tsdb.retention.time=5d"
grafana:
build: ./grafana
container_name: grafana
env_file:
- .env
networks:
- transcendence
volumes:
- grafana-data:/var/lib/grafana
restart: "unless-stopped"
# Exporters
postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.15.0
container_name: postgres-exporter
restart: "unless-stopped"
depends_on:
- postgres
networks:
- transcendence
env_file:
- .env
es-exporter:
image: prometheuscommunity/elasticsearch-exporter:v1.6.0
container_name: es-exporter
command:
- '--es.uri=http://elasticsearch:9200'
restart: "unless-stopped"
depends_on:
- setup
- elasticsearch
- kibana
- logstash
networks:
- transcendence
env_file:
- .env
# ELK
elasticsearch:
image: elasticsearch:8.11.1
container_name: elasticsearch
restart: "unless-stopped"
volumes:
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- elastic-data:/usr/share/elasticsearch/data/
networks:
- transcendence
env_file:
- .env
mem_limit: 1GB
logstash:
image: logstash:8.11.1
container_name: logstash
restart: "unless-stopped"
volumes:
- ./logstash/config:/usr/share/logstash/config:ro
- ./logstash/pipeline:/usr/share/logstash/pipeline:ro
- common-log-data:/var/log/django/:ro
- nginx-logs-data:/var/log/nginx/:ro
depends_on:
- elasticsearch
env_file:
- .env
networks:
- transcendence
mem_limit: 1GB
kibana:
image: kibana:8.11.1
container_name: kibana
restart: "unless-stopped"
volumes:
- ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
env_file:
- .env
depends_on:
- elasticsearch
networks:
- transcendence
setup:
container_name: setup
build: ./setup
depends_on:
- elasticsearch
restart: "no"
networks:
- transcendence
env_file:
- .env