-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
executable file
·141 lines (121 loc) · 5.07 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
x-influxdb-shared-vars: &influxdb-shared-vars
# InfluxDB will create the specified database and an admin account with the specified credentials.
# More info: https://github.com/influxdata/influxdata-docker/pull/102
INFLUXDB_DB: ${INFLUXDB_DB}
INFLUXDB_ADMIN_USER: ${INFLUXDB_ADMIN_USER}
INFLUXDB_ADMIN_PASSWORD: ${INFLUXDB_ADMIN_PASSWORD}
services:
influxdb:
container_name: $INFLUXDB_CONTAINER
image: influxdb:2.7.10
volumes:
- type: volume
source: influxdb-data
target: /var/lib/influxdb
- type: bind
source: ./influxdb/docker-entrypoint-initdb.d
target: /docker-entrypoint-initdb.d
read_only: true
env_file:
- ./.env
environment:
INFLUXDB_META_DIR: /var/lib/influxdb/meta
INFLUXDB_DATA_DIR: /var/lib/influxdb/data
INFLUXDB_DATA_WAL_DIR: /var/lib/influxdb/data
INFLUXDB_DATA_MAX_SERIES_PER_DATABASE: 0
INFLUXDB_DATA_MAX_VALUES_PER_TAG: 0
INFLUXDB_DATA_SERIES_ID_SET_CACHE_SIZE: 100
INFLUXDB_HTTP_BIND_ADDRES: :${INFLUXDB_PORT}
INFLUXDB_HTTP_ENABLED: "true"
INFLUXDB_HTTP_AUTH_ENABLED: "true"
<< : *influxdb-shared-vars
networks:
- metrics
# restart: always
labels:
- "traefik.http.routers.influxdb-ssl.entryPoints=influxdb-port"
- "traefik.http.routers.influxdb-ssl.rule=host(`$METRICS_DOMAIN`)"
- "traefik.http.routers.influxdb-ssl.tls=true"
- "traefik.http.routers.influxdb-ssl.tls.certResolver=lets-encrypt-ssl"
- "traefik.http.routers.influxdb-ssl.service=influxdb-ssl"
- "traefik.http.services.influxdb-ssl.loadBalancer.server.port=$INFLUXDB_PORT"
grafana:
container_name: grafana
image: grafana/grafana:11.3.0
volumes:
- type: volume
source: grafana-data
target: /var/lib/grafana
- type: bind
source: ./grafana/provisioning
target: /etc/grafana/provisioning
read_only: true
env_file:
- ./.env
environment:
GF_PATHS_DATA: /var/lib/grafana
GF_PATHS_PLUGINS: /var/lib/grafana/plugins
GF_PATHS_PROVISIONING: /etc/grafana/provisioning
GF_SERVER_HTTP_PORT: 3000
GF_SERVER_METRICS_DOMAIN: ${METRICS_DOMAIN}
GF_SERVER_ROOT_URL: https://${METRICS_DOMAIN}
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
GF_LOG_MODE: console
# Variables for setting up the InfluxDB data source
<< : *influxdb-shared-vars
networks:
- metrics
# restart: always
depends_on:
- $INFLUXDB_CONTAINER
labels:
# Router for redirecting HTTP traffic to the router receiving HTTPS traffic.
- "traefik.http.routers.grafana.entryPoints=port80"
- "traefik.http.routers.grafana.rule=host(`$METRICS_DOMAIN`)"
- "traefik.http.routers.grafana.middlewares=grafana-redirect"
- "traefik.http.middlewares.grafana-redirect.redirectScheme.scheme=https"
- "traefik.http.middlewares.grafana-redirect.redirectScheme.permanent=true"
- "traefik.http.routers.grafana-ssl.entryPoints=port443"
- "traefik.http.routers.grafana-ssl.rule=host(`$METRICS_DOMAIN`)"
- "traefik.http.routers.grafana-ssl.tls=true"
- "traefik.http.routers.grafana-ssl.tls.certResolver=lets-encrypt-ssl"
- "traefik.http.routers.grafana-ssl.service=grafana-ssl"
- "traefik.http.services.grafana-ssl.loadBalancer.server.port=3000"
traefik:
container_name: traefik
image: traefik:v3.1.6
volumes:
- type: volume
source: traefik-data
target: /letsencrypt
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
read_only: true
networks:
- metrics
# restart: always
ports:
- "80:80"
- "443:443"
- "$INFLUXDB_PORT:$INFLUXDB_PORT"
command:
- "--providers.docker=true"
- "--entryPoints.port443.address=:443"
- "--entryPoints.port80.address=:80"
- "--entryPoints.influxdb-port.address=:$INFLUXDB_PORT"
- "--certificatesResolvers.lets-encrypt-ssl.acme.tlsChallenge=true"
- "--certificatesResolvers.lets-encrypt-ssl.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.lets-encrypt-ssl.acme.caServer=${CA_SERVER}"
- "--certificatesResolvers.lets-encrypt-ssl.acme.email=${LETS_ENCRYPT_EMAIL}"
networks:
metrics:
driver: bridge
volumes:
influxdb-data:
external: false
grafana-data:
external: false
traefik-data:
external: false