first version
This commit is contained in:
38
templates/labels.j2
Normal file
38
templates/labels.j2
Normal file
@@ -0,0 +1,38 @@
|
||||
{% if immich_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if immich_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ immich_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
{% set middlewares = [] %}
|
||||
|
||||
{% if immich_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.{{ immich_identifier }}-slashless-redirect.redirectregex.regex=^({{ immich_container_labels_traefik_path_prefix | quote }})$
|
||||
traefik.http.middlewares.{{ immich_identifier }}-slashless-redirect.redirectregex.replacement=${1}/
|
||||
{% set middlewares = middlewares + [immich_identifier + '-slashless-redirect'] %}
|
||||
{% endif %}
|
||||
|
||||
{% if immich_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.{{ immich_identifier }}-strip-prefix.stripprefix.prefixes={{ immich_container_labels_traefik_path_prefix }}
|
||||
{% set middlewares = middlewares + [immich_identifier + '-strip-prefix'] %}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.{{ immich_identifier }}.rule={{ immich_container_labels_traefik_rule }}
|
||||
{% if immich_container_labels_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.{{ immich_identifier }}.priority={{ immich_container_labels_traefik_priority }}
|
||||
{% endif %}
|
||||
traefik.http.routers.{{ immich_identifier }}.service={{ immich_identifier }}
|
||||
{% if middlewares | length > 0 %}
|
||||
traefik.http.routers.{{ immich_identifier }}.middlewares={{ middlewares | join(',') }}
|
||||
{% endif %}
|
||||
traefik.http.routers.{{ immich_identifier }}.entrypoints={{ immich_container_labels_traefik_entrypoints }}
|
||||
traefik.http.routers.{{ immich_identifier }}.tls={{ immich_container_labels_traefik_tls | to_json }}
|
||||
{% if immich_container_labels_traefik_tls %}
|
||||
traefik.http.routers.{{ immich_identifier }}.tls.certResolver={{ immich_container_labels_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.{{ immich_identifier }}.loadbalancer.server.port=8080
|
||||
{% endif %}
|
||||
|
||||
{{ immich_container_labels_additional_labels }}
|
||||
Reference in New Issue
Block a user