-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
234 lines (214 loc) · 7.49 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
services:
exporter:
build:
context: .
dockerfile: Dockerfile
args:
# The source root of the exporter project. This variable will be placed in the .env file
# at the project root when the project is built for the first time.
# It is used to determine the location of the source files in the container, so source
# map references in the logs will point to the correct location on the host, which makes
# debugging a lot easier.
SOURCE_ROOT: "${EXPORTER_SOURCE_ROOT:-./iss-exporter/src}"
LISTEN_PORT: ${EXPORTER_LISTEN_PORT:-3000}
restart: unless-stopped
environment:
LOG_LEVEL: "${EXPORTER_LOG_LEVEL:-info}"
UPDATE_INTERVAL: "${EXPORTER_UPDATE_INTERVAL:-1000}"
METRICS_PREFIX: "${EXPORTER_METRICS_PREFIX:-iss}"
NODE_METRICS: "${EXPORTER_NODE_METRICS:-true}"
NODE_METRICS_PREFIX: "${EXPORTER_NODE_METRICS:-node}"
WEB_SERVER_METRICS: "${EXPORTER_WEB_SERVER_METRICS:-true}"
WEB_SERVER_METRICS_PREFIX: "${EXPORTER_WEB_SERVER_METRICS_PREFIX:-express}"
POSITION_UPDATE_FREQUENCY: "${EXPORTER_POSITION_UPDATE_FREQUENCY:-2000}"
SUBSCRIPTION_ENDPOINT: "${EXPORTER_SUBSCRIPTION_ENDPOINT:-https://push.lightstreamer.com}"
SUBSCRIPTION_ADAPTER: "${EXPORTER_SUBSCRIPTION_ADAPTER:-ISSLIVE}"
POSITION_API_URL: "${EXPORTER_POSITION_API_URL:-http://api.open-notify.org/iss-now.json}"
METRICS_ENDPOINT: "${EXPORTER_METRICS_ENDPOINT:-/metrics}"
STATUS_ENDPOINT: "${EXPORTER_STATUS_ENDPOINT:-/status}"
TIME_SIGNAL_NAME: "${EXPORTER_TIME_SIGNAL_NAME:-TIME_000001}"
healthcheck:
test:
- "CMD"
- "curl"
- "-f"
- "http://localhost:${EXPORTER_LISTEN_PORT:-3000}${EXPORTER_STATUS_ENDPOINT:-/status}"
interval: 30s
timeout: 10s
retries: 3
networks:
- monitoring
expose:
- "${EXPORTER_LISTEN_PORT:-3000}"
grafana:
image: "grafana/grafana-oss:${GRAFANA_VERSION:-latest}"
restart: unless-stopped
environment:
GF_SERVER_DOMAIN: "${SITE_DOMAIN:-localhost}"
GF_SMTP_EHLO_IDENTITY: "${SITE_DOMAIN:-localhost}"
# Ensure logs are written to stdout immediately
GF_LOG_MODE: console
healthcheck:
test:
- "CMD"
- "wget"
- "--quiet"
- "http://localhost:3000/api/health"
- "--output-document"
- "-"
interval: 10s
timeout: 15s
retries: 10
start_period: 40s
volumes:
# This volume mounts the main Grafana configuration into the Grafana container.
- source: ./grafana/grafana.ini
target: /etc/grafana/grafana.ini
type: bind
consistency: cached
read_only: true
# This volume mounts the custom datasources configuration.
# It configures the datasources to be provisioned.
- source: ./grafana/datasources.yaml
target: /etc/grafana/provisioning/datasources/main.yaml
type: bind
consistency: cached
read_only: true
# This volume mounts the custom dashboards configuration.
# It configures the dashboards to be provisioned.
- source: ./grafana/dashboards.yaml
target: /etc/grafana/provisioning/dashboards/main.yaml
type: bind
consistency: cached
read_only: true
# This volume mounts the custom dashboards.
# They will be provisioned automatically.
- source: ./grafana/dashboards
target: /etc/grafana/dashboards
type: bind
consistency: cached
read_only: true
# This volume mounts the custom markers (e.g. the ISS icon used on the map).
- source: ./grafana/markers
target: /usr/share/grafana/public/img/icons/marker
type: bind
consistency: cached
read_only: true
# This volume holds the Grafana database and other data generated at runtime.
# You should not delete this volume if you want to keep adjustments and dashboards.
- source: grafana_data
target: /var/lib/grafana
type: volume
expose:
- 3000
networks:
- default
- monitoring
prometheus:
image: "prom/prometheus:${PROMETHEUS_VERSION:-latest}"
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME:-14d}"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--web.user-assets=/user"
- "--web.enable-admin-api"
- "--web.page-title=Prometheus: ISS Metrics"
- "--web.external-url=${URL_PREFIX_PROMETHEUS:-/prometheus}"
- "--web.route-prefix=${URL_PREFIX_PROMETHEUS:-/prometheus}"
- "--log.format=json"
- "--log.level=warn"
healthcheck:
test:
- "CMD"
- "wget"
- "--quiet"
- "http://localhost:9090${URL_PREFIX_PROMETHEUS:-/prometheus}/-/healthy"
- "--output-document"
- "-"
interval: 30s
timeout: 10s
retries: 3
volumes:
# This volume mounts the main Prometheus configuration.
- source: ./prometheus/prometheus.yaml
target: /etc/prometheus/prometheus.yaml
type: bind
consistency: cached
read_only: true
# This volume mounts the individual scrape target configurations.
- source: ./prometheus/targets
target: /etc/prometheus/targets
type: bind
consistency: cached
read_only: true
# This volume mounts public assets into the Prometheus container.
- source: ./public
target: /user
type: bind
consistency: cached
read_only: true
# This volume holds the Prometheus database and other data generated at runtime.
# You should not delete this volume if you want to keep your metrics history.
- source: prometheus_data
read_only: false
target: /prometheus
type: volume
networks:
- monitoring
expose:
- 9090
caddy:
image: "caddy:${CADDY_VERSION:-latest}"
restart: unless-stopped
environment:
SITE_DOMAIN: "${SITE_DOMAIN:-localhost}"
EMAIL: "admin@${SITE_DOMAIN:-localhost}"
TRUSTED_PROXIES: "${TRUSTED_PROXIES:-private_ranges}"
HOMEPAGE: "${HOMEPAGE:-${URL_PREFIX_GRAFANA:-/grafana}/}"
URL_PREFIX_ASSETS: "${URL_PREFIX_ASSETS:-/assets}"
URL_PREFIX_GRAFANA: "${URL_PREFIX_GRAFANA:-/grafana}"
UPSTREAM_GRAFANA: "grafana:3000"
EXPOSE_PROMETHEUS: "${EXPOSE_PROMETHEUS:-true}"
URL_PREFIX_PROMETHEUS: "${URL_PREFIX_PROMETHEUS:-/prometheus}"
UPSTREAM_PROMETHEUS: "prometheus:9090"
healthcheck:
test: [ "CMD", "wget", "--quiet", "http://localhost:2020/health", "--output-document", "-" ]
interval: 30s
timeout: 10s
retries: 3
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
- ./caddy/error-pages:/error-pages:ro
- ./public:/srv:ro
- caddy_data:/data
- caddy_config:/config
networks:
- default
- monitoring
ports:
- published: "${HTTP_PORT:-3000}"
target: 80
protocol: tcp
mode: host
- published: "${HTTPS_PORT:-3010}"
target: 443
protocol: tcp
mode: host
- published: "${HTTPS_PORT:-3010}"
target: 443
protocol: udp
mode: host
expose:
- 2019
networks:
default:
monitoring:
driver: bridge
volumes:
grafana_data:
prometheus_data:
caddy_data:
caddy_config: