This commit is contained in:
2023-04-08 13:09:04 -04:00
parent 0c3503b10b
commit 6675f49a6e
5 changed files with 86 additions and 47 deletions

View File

@@ -0,0 +1,8 @@
# {{ ansible_managed }}
traefik_version={{ traefik_version }}
traefik_name={{ traefik_name }}
traefik_domain={{ gitea_domain }}
traefik_dashboard={{ traefik_dashboard | string | lower }}
traefik_debug={{ traefik_debug | string | lower }}
traefik_web_entry={{ traefik_web_entry }}
traefik_websecure_entry={{ traefik_websecure_entry }}

View File

@@ -0,0 +1,42 @@
version: '3.7'
networks:
traefik:
name: traefik
services:
traefik:
image: "traefik:${traefik_version}"
container_name: "${traefik_name}"
command:
- --api.dashboard=${traefik_dashboard:-false}
- --api.debug=${traefik_debug:-false}
- --providers.docker=true
- --entrypoints.web.address=:80
{% if traefik_standalone %}
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.permanent=true
- --entrypoints.websecure.address=:443
{% endif %}
ports:
- "${traefik_web_entry:-80:80}"
{% if traefik_standalone %}
- "${traefik_websecure_entry:-443:443}"
{% endif %}
networks:
- traefik
labels:
- "traefik.http.routers.traefik.rule=Host(`{{ traefik_domain }}`)"
- "traefik.http.routers.traefik.service=api@internal"
{% if traefik_standalone %}
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls=true"
{% else %}
- "traefik.http.routers.traefik.entrypoints=web"
{% endif %}
- "traefik.docker.network=traefik"
- "traefik.enable=${traefik_dashboard:-false}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "{{ traefik_root }}/config:/etc/traefik"