-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-services.yml
134 lines (134 loc) · 5.17 KB
/
docker-compose-services.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
services:
reverse-proxy:
image: traefik:v3.0
labels:
- traefik.enable=true
- traefik.http.routers.mydashboard.rule=Host(`traefik.${STACK_HOSTNAME}`)
- traefik.http.routers.mydashboard.service=api@internal
- traefik.http.routers.mydashboard.middlewares=test-things-auth
command:
- "--log.level=DEBUG"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.watch"
- "--metrics.prometheus=true"
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
- "--entrypoints.web.address=:${WEB_PORT_IN}"
- "--entrypoints.modbus-elevator.address=:${MODBUS_ELEVATOR_PORT_IN}"
- "--entrypoints.coap-calculator-simple.address=:${COAP_SIMPLE_PORT_IN}/udp"
- "--entrypoints.coap-calculator-content-negotiation.address=:${COAP_NEGOTIATION_PORT_IN}/udp"
- "--entrypoints.smart-home-smart-clock.address=:${SMART_HOME_SMART_CLOCK_PORT_IN}/udp"
ports:
- "${WEB_PORT_OUT}:${WEB_PORT_IN}"
- "${MODBUS_ELEVATOR_PORT_OUT}:${MODBUS_ELEVATOR_PORT_IN}"
- "${COAP_SIMPLE_PORT_OUT}:${COAP_SIMPLE_PORT_IN}/udp"
- "${COAP_NEGOTIATION_PORT_OUT}:${COAP_NEGOTIATION_PORT_IN}/udp"
- "${SMART_HOME_SMART_CLOCK_PORT_OUT}:${SMART_HOME_SMART_CLOCK_PORT_IN}/udp"
- "${TRAEFIK_DASHBOARD_PORT_OUT}:${TRAEFIK_DASHBOARD_PORT_IN}"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
networks:
- things_network
test-things-auth:
image: thomseddon/traefik-forward-auth:2
environment:
- DEFAULT_PROVIDER=generic-oauth
- SECRET=${OAUTH_SECRET}
- PROVIDERS_GENERIC_OAUTH_AUTH_URL=${GITHUB_AUTH_URL}
- PROVIDERS_GENERIC_OAUTH_TOKEN_URL=${GITHUB_TOKEN_URL}
- PROVIDERS_GENERIC_OAUTH_USER_URL=${GITHUB_USER_URL}
- PROVIDERS_GENERIC_OAUTH_CLIENT_ID=${GITHUB_CLIENT_ID}
- PROVIDERS_GENERIC_OAUTH_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
- PROVIDERS_GENERIC_OAUTH_SCOPE=user,repo
- INSECURE_COOKIE=true
- LOG_LEVEL=debug
- WHITELIST=${WHITELISTED_EMAILS}
labels:
- "traefik.http.middlewares.test-things-auth.forwardauth.address=http://test-things-auth:${FORWARD_AUTH_PORT}"
- "traefik.http.middlewares.test-things-auth.forwardauth.authResponseHeaders=X-Forwarded-User"
- "traefik.http.services.test-things-auth.loadbalancer.server.port=${FORWARD_AUTH_PORT}"
networks:
- things_network
prometheus:
image: prom/prometheus
volumes:
- "prometheus_data:/prometheus"
- "${CONFIG_FILEPATH}/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml"
labels:
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${STACK_HOSTNAME}`)"
- "traefik.http.routers.prometheus.service=prometheus"
- "traefik.http.routers.prometheus.middlewares=test-things-auth"
- "traefik.http.services.prometheus.loadbalancer.server.port=${PROMETHEUS_PORT}"
depends_on:
- cadvisor
networks:
- things_network
grafana:
image: grafana/grafana
environment:
- PROMETHEUS_PORT=${PROMETHEUS_PORT}
- GF_SERVER_DOMAIN=grafana.${STACK_HOSTNAME}
- GF_SERVER_ROOT_URL=http://grafana.${STACK_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
volumes:
- ${CONFIG_FILEPATH}/grafana/provisioning:/etc/grafana/provisioning
- ${CONFIG_FILEPATH}/grafana/dashboards:/var/lib/grafana/dashboards
- grafana_data:/var/lib/grafana
labels:
- "traefik.http.routers.grafana.rule=Host(`grafana.${STACK_HOSTNAME}`)"
- "traefik.http.routers.grafana.service=grafana"
- "traefik.http.services.grafana.loadbalancer.server.port=${GRAFANA_PORT}"
depends_on:
- prometheus
networks:
- things_network
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
labels:
- "traefik.http.routers.cadvisor.rule=Host(`cadvisor.${STACK_HOSTNAME}`)"
- "traefik.http.routers.cadvisor.service=cadvisor"
- "traefik.http.routers.cadvisor.middlewares=test-things-auth"
- "traefik.http.services.cadvisor.loadbalancer.server.port=${CADVISOR_PORT}"
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- things_network
loki:
image: grafana/loki:2.9.2
# labels:
# - "traefik.http.routers.loki.rule=Host(`loki.${STACK_HOSTNAME}`)"
# - "traefik.http.routers.loki.service=loki"
# - "traefik.http.services.loki.loadbalancer.server.port=${LOKI_PORT}"
ports:
- "3100:3100"
volumes:
- ${CONFIG_FILEPATH}/loki/loki-config.yaml:/etc/loki/local-config.yaml
networks:
- things_network
promtail:
image: grafana/promtail:2.9.2
volumes:
- /var/log:/var/log
- ${CONFIG_FILEPATH}/promtail/promtail-config.yaml:/etc/promtail/config.yaml
networks:
- things_network
mosquitto:
image: eclipse-mosquitto:2
ports:
- "${MOSQUITTO_PORT_IN}:${MOSQUITTO_PORT_IN}"
volumes:
- ${CONFIG_FILEPATH}/mosquitto:/mosquitto/config
networks:
- things_network
volumes:
prometheus_data:
grafana_data:
networks:
things_network:
name: things_network
driver: 'bridge'