-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
docker-compose.yaml
212 lines (208 loc) · 5.35 KB
/
docker-compose.yaml
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
---
# This is just to hold a bunch of yaml anchors and try to consolidate parts of
# the config.
x-anchors:
go: &go-image quay.io/projectquay/golang:1.22
grafana: &grafana-image docker.io/grafana/grafana:8.0.3
jaeger: &jaeger-image docker.io/jaegertracing/all-in-one:1.26
pgadmin: &pgadmin-image docker.io/dpage/pgadmin4:5.7
postgres: &postgres-image docker.io/library/postgres:12
prom: &prom-image docker.io/prom/prometheus:v2.30.2
pyroscope: &pyroscope-image docker.io/pyroscope/pyroscope:0.37.2
quay: &quay-image quay.io/projectquay/quay:latest
rabbitmq: &rabbitmq-image docker.io/library/rabbitmq:3.11
redis: &redis-image docker.io/library/redis:6.2
skopeo: &skopeo-image quay.io/skopeo/stable:latest
traefik: &traefik-image docker.io/library/traefik:v2.2
clair-service: &clair-service
image: *go-image
depends_on:
clair-database:
condition: service_healthy
volumes:
- "./local-dev/clair:/etc/clair:ro"
- ".:/src"
# Can't specify the config via environment because maps are not recursively
# merged.
command:
- go
- run
- .
- -conf
- /etc/clair/${CLAIR_CONFIG:-config.yaml}
restart: unless-stopped
working_dir: /src/cmd/clair
services:
indexer:
<<: *clair-service
container_name: clair-indexer
environment:
CLAIR_MODE: "indexer"
matcher:
<<: *clair-service
container_name: clair-matcher
environment:
CLAIR_MODE: "matcher"
clair-database:
container_name: clair-database
image: *postgres-image
environment:
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- type: bind
source: ./local-dev/clair/init.sql
target: /docker-entrypoint-initdb.d/init.sql
healthcheck:
test:
- CMD-SHELL
- "pg_isready -U postgres"
interval: 5s
timeout: 4s
retries: 12
start_period: 10s
traefik:
container_name: clair-traefik
image: *traefik-image
depends_on:
- matcher
- indexer
ports:
- '6060:6060'
- '8080:8080'
- '8443'
- '5432'
volumes:
- './local-dev/traefik/:/etc/traefik/:ro'
# Debugging services -- use profile 'debug'
pgadmin:
container_name: clair-pgadmin
profiles:
- debug
image: *pgadmin-image
environment:
PGADMIN_DEFAULT_EMAIL: clair@clair.com
PGADMIN_DEFAULT_PASSWORD: clair
PGADMIN_SERVER_JSON_FILE: /pgadmin4/config/servers.json
SCRIPT_NAME: /pgadmin
volumes:
- "./local-dev/pgadmin:/pgadmin4/config"
depends_on:
- clair-database
jaeger:
container_name: clair-jaeger
profiles:
- debug
image: *jaeger-image
environment:
QUERY_BASE_PATH: '/jaeger'
prometheus:
container_name: clair-prometheus
profiles:
- debug
image: *prom-image
volumes:
- "./local-dev/prometheus:/etc/prometheus/"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.external-url=http://localhost:8080/prom/'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
pyroscope:
container_name: clair-pyroscope
profiles:
- debug
image: *pyroscope-image
volumes:
- ./local-dev/pyroscope:/etc/pyroscope/
command:
- server
environment:
PYROSCOPE_LOG_LEVEL: info
PYROSCOPE_WAIT_AFTER_STOP: 'true'
grafana:
container_name: clair-grafana
profiles:
- debug
image: *grafana-image
user: "472"
environment:
GF_SERVER_ROOT_URL: /grafana
GF_SERVER_SERVE_FROM_SUB_PATH: 'true'
GF_INSTALL_PLUGINS: 'pyroscope-datasource,pyroscope-panel'
volumes:
- ./local-dev/grafana/provisioning/:/etc/grafana/provisioning/
depends_on:
- prometheus
- pyroscope
# Notifier services -- use profile 'notifier'
notifier: ¬ifier
<<: *clair-service
container_name: clair-notifier
profiles:
- notifier
environment:
CLAIR_MODE: "notifier"
NOTIFIER_TEST_MODE: "true"
webhook-target:
<<: *clair-service
container_name: webhook-target
profiles:
- notifier
working_dir: /src
depends_on: {}
command:
- go
- run
- ./notifier/webhook/cmd/webhookd
- -D
- -key
- c2VjcmV0
rabbitmq:
# This provides STOMP and AMQP on the usual ports.
# The web UI is available on /rabbitmq
container_name: clair-rabbitmq
profiles:
- notifier
image: *rabbitmq-image
command:
- sh
- -c
- |
set -e
rabbitmq-plugins enable rabbitmq_stomp rabbitmq_management >/dev/null
exec rabbitmq-server
# Quay -- starts a Quay stack for integration testing.
# Use profile 'quay'
quay:
container_name: clair-quay
profiles:
- quay
image: *quay-image
volumes:
- "./local-dev/quay:/quay-registry/conf/stack"
environment:
DEBUGLOG: "true"
IGNORE_VALIDATION: "true"
depends_on:
- redis
- clair-database
redis:
container_name: quay-redis
profiles:
- quay
image: *redis-image
quay-notifier:
<<: *notifier
profiles:
- quay
environment:
CLAIR_MODE: "notifier"
skopeo:
container_name: quay-skopeo
profiles:
- quay
image: *skopeo-image
entrypoint:
- sleep
- inf