Skip to content

Commit 9350c1f

Browse files
author
june012006
committed
Add traefik snippet to autokuma
1 parent 141b4a5 commit 9350c1f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

autokuma/compose.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ services:
2525
# {{container_name}}_http.http.url: https://{{@0}}:{{@1}}
2626
# {{container_name}}_docker.docker.name: {{container_name}} Docker
2727
# {{container_name}}_docker.docker.docker_container: {{container_name}}
28+
AUTOKUMA__SNIPPETS_!traefik.enable: |-
29+
{# Only apply if value is "true" #}
30+
{% if args[0] == "true" %}
31+
{# Extract some information from existing labels, note that this will likely not fit your setup and you will need to adjust this to get the required data #}
32+
{% set traefik_service = container_name %}
33+
{% set domain = container_name + ".example.com" %}
34+
{% set port = container["Labels"]["traefik.http.services." + traefik_service + ".loadbalancer.server.port"] %}
35+
{{ container_name }}_http.http.name: {{ container_name }}
36+
{{ container_name }}_http.http.url: https://{{ domain }}:{{ port }}
37+
{% endif %}
2838
AUTOKUMA__DOCKER__HOSTS: tcp://192.168.128.3:2375;tcp://192.168.25.4:2375;tcp://192.168.128.249:2375
2939
# AUTOKUMA__DOCKER__LABEL_PREFIX: kuma
3040

0 commit comments

Comments
 (0)