forked from sodafoundation/delfin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
136 lines (126 loc) · 4.52 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
# Copyright 2020 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Installation Steps:
# ------------------
#
# 1. Create the 'sodafoundation/delfin' docker image with Dockerfile in
# delfin project using command below. (Note: In future we will upload
# this image to docker-hub and it can be downloaded with out this step)
#
# $ docker build -t sodafoundation/delfin .
#
# 2. Export (optional) environment vars for hostnames for redis, rabbitmq and credentials for rabbitmq. Eg.
# Here is example for exporting variable and its current values in setup.
#
# $ export DELFIN_RABBITMQ_USER=delfinuser
# $ export DELFIN_RABBITMQ_PASS=delfinpass
# $ export DELFIN_RABBITMQ_HOSTNAME=rabbitmq
# $ export DELFIN_REDIS_HOSTNAME=redis
# $ export DELFIN_METRICS_DIR=/var/lib/delfin/metrics
#
# 3. Bring up delfin project using following command
#
# $ docker-compose up -d
#
# 4. When finished using delfin project, bring down containers using following command
#
# $ docker-compose down
#
# 5. To bring up delfin project with multiple service instances
#
# $ docker-compose up -d --scale <<service-name>>=<<number of instances>>
#
# example: Deploy delfin with 3 delfin-task and 2 delfin-alert instances
# $ docker-compose up -d --scale delfin-task=3 --scale delfin-alert=2
# Note: Multiple instances of delfin-api are not allowed
version: '3.3'
services:
redis:
image: redis
container_name: ${DELFIN_REDIS_HOSTNAME:-redis}
command: redis-server
ports:
- 6379:6379
restart: always
rabbitmq:
image: rabbitmq:3-management
container_name: ${DELFIN_RABBITMQ_HOSTNAME:-rabbitmq}
environment:
RABBITMQ_DEFAULT_USER: ${DELFIN_RABBITMQ_USER:-delfinuser}
RABBITMQ_DEFAULT_PASS: ${DELFIN_RABBITMQ_PASS:-delfinpass}
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- 5672:5672
- 15672:15672
restart: always
delfin-api:
image: sodafoundation/delfin
command: "api"
volumes:
- ./etc/delfin:/etc/delfin
- db_data:/var/lib/delfin
ports:
- 8190:8190
restart: always
environment:
- OS_COORDINATION__BACKEND_SERVER=${DELFIN_REDIS_HOSTNAME:-redis}:6379
- OS_DEFAULT__TRANSPORT_URL=rabbit://${DELFIN_RABBITMQ_USER:-delfinuser}:${DELFIN_RABBITMQ_PASS:-delfinpass}@${DELFIN_RABBITMQ_HOSTNAME:-rabbitmq}:5672//
depends_on:
- redis
- rabbitmq
delfin-task:
image: sodafoundation/delfin
command: "task"
volumes:
- ./etc/delfin:/etc/delfin
- db_data:/var/lib/delfin
- metrics_dir:${DELFIN_METRICS_DIR:-/var/lib/delfin/metrics}
restart: always
environment:
- OS_COORDINATION__BACKEND_SERVER=${DELFIN_REDIS_HOSTNAME:-redis}:6379
- OS_DEFAULT__TRANSPORT_URL=rabbit://${DELFIN_RABBITMQ_USER:-delfinuser}:${DELFIN_RABBITMQ_PASS:-delfinpass}@${DELFIN_RABBITMQ_HOSTNAME:-rabbitmq}:5672//
- OS_PROMETHEUS_EXPORTER__METRICS_DIR=${DELFIN_METRICS_DIR:-/var/lib/delfin/metrics}
depends_on:
- redis
- rabbitmq
delfin-alert:
image: sodafoundation/delfin
command: "alert"
volumes:
- ./etc/delfin:/etc/delfin
- db_data:/var/lib/delfin
restart: always
environment:
- OS_COORDINATION__BACKEND_SERVER=${DELFIN_REDIS_HOSTNAME:-redis}:6379
- OS_DEFAULT__TRANSPORT_URL=rabbit://${DELFIN_RABBITMQ_USER:-delfinuser}:${DELFIN_RABBITMQ_PASS:-delfinpass}@${DELFIN_RABBITMQ_HOSTNAME:-rabbitmq}:5672//
depends_on:
- redis
- rabbitmq
delfin-exporter:
image: sodafoundation/delfin
command: "exporter"
volumes:
- ./etc/delfin:/etc/delfin
- metrics_dir:${DELFIN_METRICS_DIR:-/var/lib/delfin/metrics}
ports:
- 8195:8195
restart: always
environment:
- OS_DEFAULT__TRANSPORT_URL=rabbit://${DELFIN_RABBITMQ_USER:-delfinuser}:${DELFIN_RABBITMQ_PASS:-delfinpass}@${DELFIN_RABBITMQ_HOSTNAME:-rabbitmq}:5672//
- OS_PROMETHEUS_EXPORTER__METRICS_DIR=${DELFIN_METRICS_DIR:-/var/lib/delfin/metrics}
depends_on:
- rabbitmq
volumes:
db_data: {}
metrics_dir: {}