-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
256 lines (241 loc) · 6.07 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
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
version: "3.7"
# networks
networks:
proxy:
driver: bridge
driver_opts:
com.docker.network.bridge.name: trmmproxy
ipam:
driver: default
config:
- subnet: ${PROXY_SUBNET}/24
gateway: ${PROXY_GATEWAY}
api-db:
driver: bridge
driver_opts:
com.docker.network.bridge.name: trmmnats
ipam:
driver: default
config:
- subnet: ${API_DB_SUBNET}/24
gateway: ${API_DB_GATEWAY}
redis:
driver: bridge
ipam:
driver: default
config:
- subnet: ${REDIS_SUBNET}/24
gateway: ${REDIS_GATEWAY}
mesh-db:
driver: bridge
ipam:
driver: default
config:
- subnet: ${MESH_SUBNET}/24
gateway: ${MESH_GATEWAY}
# docker managed persistent volumes
volumes:
tactical_data:
postgres_data:
mongo_data:
mesh_data:
redis_data:
services:
# postgres database for api service
tactical-postgres:
container_name: trmm-postgres
image: postgres:13-alpine
restart: always
environment:
POSTGRES_DB: tacticalrmm
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASS}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
api-db:
ipv4_address: ${POSTGRES_IP}
# redis container for celery tasks
tactical-redis:
container_name: trmm-redis
image: redis:6.0-alpine
user: 1000:1000
command: redis-server
restart: always
volumes:
- redis_data:/data
networks:
- redis
# used to initialize the docker environment
tactical-init:
container_name: trmm-init
image: ${IMAGE_REPO}tactical:${VERSION}
restart: on-failure
command: [ "tactical-init" ]
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASS: ${POSTGRES_PASS}
APP_HOST: ${APP_HOST}
API_HOST: ${API_HOST}
MESH_USER: ${MESH_USER}
MESH_HOST: ${MESH_HOST}
TRMM_USER: ${TRMM_USER}
TRMM_PASS: ${TRMM_PASS}
depends_on:
- tactical-postgres
- tactical-meshcentral
- tactical-redis
networks:
- api-db
- proxy
- redis
volumes:
- tactical_data:/opt/tactical
- mesh_data:/meshcentral-data
- mongo_data:/mongo/data/db
- redis_data:/redis/data
# nats
tactical-nats:
container_name: trmm-nats
image: ${IMAGE_REPO}tactical-nats:${VERSION}
user: 1000:1000
restart: always
environment:
API_HOST: ${API_HOST}
ports:
- ${NATS_EXP_PORT}:4222
volumes:
- tactical_data:/opt/tactical
networks:
api-db:
proxy:
aliases:
- ${API_HOST}
# meshcentral container
tactical-meshcentral:
container_name: trmm-meshcentral
image: ${IMAGE_REPO}tactical-meshcentral:${VERSION}
user: 1000:1000
restart: always
environment:
MESH_HOST: ${MESH_HOST}
MESH_USER: ${MESH_USER}
MESH_PASS: ${MESH_PASS}
MONGODB_USER: ${MONGODB_USER}
MONGODB_PASSWORD: ${MONGODB_PASSWORD}
MESH_PERSISTENT_CONFIG: ${MESH_PERSISTENT_CONFIG}
networks:
proxy:
aliases:
- ${MESH_HOST}
mesh-db:
volumes:
- tactical_data:/opt/tactical
- mesh_data:/home/node/app/meshcentral-data
depends_on:
- tactical-mongodb
# mongodb container for meshcentral
tactical-mongodb:
container_name: trmm-mongodb
image: mongo:4.4
user: 1000:1000
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
MONGO_INITDB_DATABASE: meshcentral
networks:
- mesh-db
volumes:
- mongo_data:/data/db
# container that hosts vue frontend
tactical-frontend:
container_name: trmm-frontend
image: ${IMAGE_REPO}tactical-frontend:${VERSION}
user: 1000:1000
restart: always
networks:
- proxy
environment:
API_HOST: ${API_HOST}
# container for django backend
tactical-backend:
container_name: trmm-backend
image: ${IMAGE_REPO}tactical:${VERSION}
user: 1000:1000
command: [ "tactical-backend" ]
restart: always
networks:
- proxy
- api-db
- redis
volumes:
- tactical_data:/opt/tactical
depends_on:
- tactical-postgres
# container for django websockets connections
tactical-websockets:
container_name: trmm-websockets
image: ${IMAGE_REPO}tactical:${VERSION}
user: 1000:1000
command: [ "tactical-websockets" ]
restart: always
networks:
- proxy
- api-db
- redis
volumes:
- tactical_data:/opt/tactical
depends_on:
- tactical-postgres
- tactical-backend
# container for tactical reverse proxy
tactical-nginx:
container_name: trmm-nginx
image: ${IMAGE_REPO}tactical-nginx:${VERSION}
user: 1000:1000
restart: always
environment:
APP_HOST: ${APP_HOST}
API_HOST: ${API_HOST}
MESH_HOST: ${MESH_HOST}
networks:
proxy:
ipv4_address: ${PROXY_IP}
ports:
- ${HTTP_EXP_PORT}:8080
- ${HTTPS_EXP_PORT}:4443
volumes:
- tactical_data:/opt/tactical
# container for celery worker service
tactical-celery:
container_name: trmm-celery
image: ${IMAGE_REPO}tactical:${VERSION}
user: 1000:1000
command: [ "tactical-celery" ]
restart: always
networks:
- redis
- proxy
- api-db
volumes:
- tactical_data:/opt/tactical
depends_on:
- tactical-postgres
- tactical-redis
# container for celery beat service
tactical-celerybeat:
container_name: trmm-celerybeat
image: ${IMAGE_REPO}tactical:${VERSION}
user: 1000:1000
command: ["tactical-celerybeat"]
restart: always
networks:
- proxy
- redis
- api-db
volumes:
- tactical_data:/opt/tactical
depends_on:
- tactical-postgres
- tactical-redis