forked from RedHatInsights/ros-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
185 lines (181 loc) · 5.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
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
version: "3.8"
services:
zookeeper:
image: confluentinc/cp-zookeeper
environment:
- ZOOKEEPER_CLIENT_PORT=32181
- ZOOKEEPER_SERVER_ID=1
kafka:
image: confluentinc/cp-kafka
ports:
- 29092:29092
- 9092:9092
depends_on:
- zookeeper
environment:
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
- KAFKA_BROKER_ID=1
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:32181
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
# Below container is to implement workaround for creating required topics.
kafka-create-topics:
image: confluentinc/cp-kafka
ports:
- 7777:29092
command: "bash -c 'echo Waiting for Kafka to be ready... && \
cub kafka-ready -b kafka:29092 1 20 && \
kafka-topics --create --if-not-exists --topic platform.inventory.events --bootstrap-server kafka:29092 && \
kafka-topics --create --if-not-exists --topic platform.engine.results --bootstrap-server kafka:29092'"
depends_on:
- kafka
minio:
image: minio/minio
command: server /data
volumes:
# These vars are defined in .env
# These are configurable
# Ensure the directories exist prior to running this file
- ./minio-conf/:/root/.minio:Z
- ./minio-data/:/data:Z
ports:
- 9000:9000
environment:
- MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY
- MINIO_SECRET_KEY=$MINIO_SECRET_KEY
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY;
/usr/bin/mc mb myminio/insights-upload-perma;
/usr/bin/mc mb myminio/insights-upload-rejected;
/usr/bin/mc policy download myminio/insights-upload-perma;
/usr/bin/mc policy download myminio/insights-upload-rejected;
exit 0;
"
ingress:
image: quay.io/cloudservices/insights-ingress:ea99e26
ports:
- 3000:3000
environment:
- INGRESS_STAGEBUCKET=insights-upload-perma
# VALIDTOPICS is required. This is derived from content type. ex: vnd.redhat.advisor.thing+tgz
- INGRESS_VALIDTOPICS=testareno,advisor,compliance,qpc
- OPENSHIFT_BUILD_COMMIT=somestring
- INGRESS_MAXSIZE=104857600
- INGRESS_MINIODEV=true
- INGRESS_MINIOACCESSKEY=$MINIO_ACCESS_KEY
- INGRESS_MINIOSECRETKEY=$MINIO_SECRET_KEY
- INGRESS_MINIOENDPOINT=minio:9000
depends_on:
- createbuckets
- kafka
db-ros:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- "15432:5432"
db-host-inventory:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: insights
POSTGRES_USER: insights
POSTGRES_DB: insights
ports:
- "15433:5432"
insights-inventory-mq: &inventory
image: quay.io/cloudservices/insights-inventory:latest
restart: always
command: "make upgrade_db run_inv_mq_service"
environment:
- APP_NAME=inventory
- PATH_PREFIX=api
- INVENTORY_DB_USER=insights
- INVENTORY_DB_PASS=insights
- INVENTORY_DB_HOST=db-host-inventory
- INVENTORY_DB_NAME=insights
- KAFKA_BOOTSTRAP_SERVERS=kafka:29092
- PAYLOAD_TRACKER_ENABLED=false
depends_on:
- kafka-create-topics
- db-host-inventory
- puptoo
- createbuckets
insights-inventory-web:
<<: *inventory
command: "make upgrade_db run_inv_web_service"
depends_on:
- insights-inventory-mq
ports:
- 8001:8080
puptoo:
image: quay.io/cloudservices/insights-puptoo:latest
ports:
- 8003:8003
environment:
- LOG_LEVEL=INFO
- FACT_EXTRACT_LOGLEVEL=ERROR
- KAFKA_ALLOW_CREATE_TOPICS=True
- DISABLE_PROMETHEUS=True
depends_on:
- kafka
- ingress
# Not yet used, we are not running clowder ATM
volumes:
- './cdappconfig.json:/cdappconfig.json:Z'
insights-engine:
image: quay.io/cloudservices/insights-engine:latest
restart: always
depends_on:
- puptoo
- kafka-create-topics
- insights-inventory-mq
# Allows us to run the application in the form it's going to be deployed, will be needed for tests
ros-processor: &ros
build:
context: ..
command: [ "python", "-m", "ros.processor.main" ]
depends_on:
- insights-inventory-web
- insights-engine
- kafka
- createbuckets
environment:
- INSIGHTS_KAFKA_HOST=kafka
- INSIGHTS_KAFKA_PORT=29092
- INVENTORY_HOST=insights-inventory-web
- INVENTORY_PORT=8000
- ROS_DB_HOST=db-ros
- ROS_DB_PORT=5432
ros-api:
<<: *ros
command: ["bash", "-c", "python -m manage db upgrade && python -m manage seed && python -m ros.api.main"]
ports:
- 8000:8000
# logging and Monitoring
grafana:
ports:
- 3001:3000
container_name: grafana
environment:
- GF_SERVER_ROOT_URL=http://grafana.server.name
- GF_SECURITY_ADMIN_PASSWORD=secret
image: grafana/grafana
prometheus:
container_name: example-prometheus
ports:
- 9090:9090
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
image: prom/prometheus