-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (70 loc) · 2.11 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
version: "3"
services:
proxy:
image: traefik:v2.9
command:
- "--api.dashboard=true"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.constraints=Label(`com.github.nmix.project`, `gate-up`)"
- "--entrypoints.pushgateway.address=:9091"
ports:
- "8080:8080"
- "9091:9091"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
labels:
- "com.github.nmix.project=gate-up"
# --- basic auth for pushgateway
- "traefik.http.routers.traefik.middlewares=auth"
# echo $(htpasswd -nb admin admin) | sed -e s/\\$/\\$\\$/g
- "traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$zhYMMcXR$$HIxTpJ.7X801hOXyrxkO3/"
app:
image: gate-up
build:
context: .
restart: unless-stopped
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./:/app
environment:
JOB_PREFIX: test
# LOG_LEVEL: INFO
# SWARM_MODE: 1
# # --- push metrics to pushgateway with auth
# PUSHGATEWAY_URL: http://pc-ip-address:19091
# PUSHGATEWAY_BASIC_AUTH_USERNAME: admin
# PUSHGATEWAY_BASIC_AUTH_PASSWORD: admin
# --- scaled service with own metrics
nodeexporter:
image: prom/node-exporter:v1.3.1
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
restart: unless-stopped
scale: 2
expose:
- 9100
labels:
- "com.github.nmix.project=gate-up"
- "com.github.nmix.gate-up.scrape"
environment:
SCRAPE_PORT: 9100
# --- pushgateway with basic auth
pushgateway:
image: prom/pushgateway
restart: unless-stopped
expose:
- 9091
labels:
- "com.github.nmix.project=gate-up"
- "traefik.http.routers.pushgateway.entrypoints=pushgateway"
- "traefik.http.routers.pushgateway.rule=PathPrefix(`/`)"
- "traefik.http.routers.pushgateway.middlewares=auth"