Skip to content

Commit 28de1f1

Browse files
committed
move each config to a separated directory
1 parent 3c799ea commit 28de1f1

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

compose.traefik.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ services:
88
set -e
99
# quote 'eof' to prevent variable expansion
1010
rm -rf /traefik_config/* || true
11-
cat <<'EOF' | tee /traefik_config/http-dynamic.yml
11+
mkdir -p /traefik_config/http /traefik_config/https
12+
cat <<'EOF' | tee /traefik_config/http/dynamic.yml
1213
http:
1314
routers:
1415
rocketchat:
@@ -37,15 +38,14 @@ services:
3738
- url: "http://grafana:3000"
3839
EOF
3940
40-
cat <<'EOF' | tee /traefik_config/https-dynamic.yml
41-
entrypoints:
42-
https:
43-
address: ":443"
44-
http:
45-
redirections:
46-
entryPoint:
47-
to: "http"
48-
scheme: "https"
41+
cat <<'EOF' | tee /traefik_config/https/dynamic.yml
42+
https:
43+
address: ":443"
44+
http:
45+
redirections:
46+
entryPoint:
47+
to: "http"
48+
scheme: "https"
4949
http:
5050
routers:
5151
rocketchat:
@@ -76,7 +76,8 @@ services:
7676
loadBalancer:
7777
servers:
7878
- url: "http://grafana:3000"
79-
EOF
79+
EOF
80+
8081
volumes:
8182
- traefik_config:/traefik_config
8283
restart: "no"
@@ -89,6 +90,7 @@ services:
8990
DOMAIN: "${DOMAIN:-localhost}"
9091
GRAFANA_DOMAIN: "${GRAFANA_DOMAIN-}"
9192
GRAFANA_PATH: "${GRAFANA_PATH-/}"
93+
TRAEFIK_PROTOCOL: "${TRAEFIK_PROTOCOL-}"
9294
command:
9395
- --api.insecure=${TRAEFIK_API_INSECURE:-false}
9496
- --providers.docker=false
@@ -106,7 +108,7 @@ services:
106108
- --metrics.prometheus.addEntryPointsLabels=true
107109
- --metrics.prometheus.addRoutersLabels=true
108110
- --metrics.prometheus.addServicesLabels=true
109-
- --providers.file.filename=/traefik_config/${TRAEFIK_PROTOCOL}-dynamic.yml
111+
- --providers.file.filename=/traefik_config/${TRAEFIK_PROTOCOL}/dynamic.yml
110112
- --providers.file.watch=true
111113
ports:
112114
- ${TRAEFIK_HTTP_PORT:-80}:${TRAEFIK_HTTP_PORT:-80}

0 commit comments

Comments
 (0)