-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-template.yml
232 lines (216 loc) · 4.99 KB
/
docker-compose-template.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
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
version: '3.8'
services:
api:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/api/main.go
container_name: api
image: technogramm/api:$VERSION
depends_on:
- postgres
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "8081:8081"
- "8079:8079"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.1
chat:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/chat/main.go
container_name: chat
image: technogramm/chat:$VERSION
depends_on:
- postgres
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9000:9000"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.2
user:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/user/main.go
container_name: user
image: technogramm/user:$VERSION
depends_on:
- postgres
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9001:9001"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.3
messages:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/messages/main.go
container_name: messages
image: technogramm/messages:$VERSION
depends_on:
- postgres
- consumer
- producer
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9002:9002"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.4
consumer:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/consumer/rabbitMQ/main.go
container_name: consumer
image: technogramm/consumer:$VERSION
depends_on:
- rabbitmq
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9003:9003"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.5
producer:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/producer/rabbitMQ/main.go
container_name: producer
image: technogramm/producer:$VERSION
depends_on:
- rabbitmq
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9004:9004"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.6
auth:
build:
args:
VERSION: $VERSION
SRC_PATH: cmd/auth/main.go
container_name: auth
image: technogramm/auth:$VERSION
depends_on:
- postgres
volumes:
- /home/ubuntu/avatars:/avatars
ports:
- "9005:9005"
restart: always
networks:
backend-network:
ipv4_address: 192.168.243.7
rabbitmq:
image: rabbitmq:latest
hostname: rabbitmq
container_name: rabbitmq
restart: always
ports:
- "5672:5672"
networks:
- backend-network
postgres:
image: postgres:latest
container_name: postgres
ports:
- "5432:5432"
volumes:
- ./db/001_init_up.sql:/docker-entrypoint-initdb.d/init.sql
- postgres_data:/var/lib/postgresql/data
restart: always
networks:
- backend-network
centrifugo:
image: centrifugo/centrifugo:latest
container_name: centrifugo
command: centrifugo -c config.json --port=8900 --admin
ports:
- "8900:8900"
volumes:
- ./config.json:/centrifugo/config.json
restart: always
networks:
- backend-network
prometheus:
hostname: prometheus
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
volumes:
- ./monitoring/prometheus:/etc/prometheus
ports:
- "9090:9090"
networks:
- backend-network
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- ./monitoring/grafana/data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./monitoring/grafana/grafana.ini:/etc/grafana/grafana.ini
restart: always
networks:
- backend-network
depends_on:
- prometheus
user: "472"
node-exporter:
hostname: node-exporter
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- "9100"
networks:
- backend-network
networks:
backend-network:
name: "backend-network"
driver: bridge
ipam:
config:
- subnet: 192.168.243.0/24
volumes:
postgres_data: { }
redis_data: { }