2023-11-19 21:41:22 +01:00
|
|
|
[Unit]
|
|
|
|
Description=Traefik with Docker
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStartPre=-/usr/bin/docker rm --force {{ traefik_container_name }}
|
|
|
|
ExecStart=/usr/bin/docker run --rm --name {{ traefik_container_name }} \
|
2023-11-27 21:13:06 +01:00
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock -v {{ docker_volumes_dir }}/traefik/traefik.yml:/traefik.yml \
|
|
|
|
-v {{ docker_volumes_dir }}/traefik/traefik_dynamic.yml:/traefik_dynamic.yml -v {{ docker_volumes_dir }}/traefik/letsencrypt/:/letsencrypt \
|
2023-11-19 21:41:22 +01:00
|
|
|
-p 80:80 -p 443:443 -p 8448:8448 --network traefik traefik:v2.10.5
|
|
|
|
ExecStop=/usr/bin/docker stop {{ traefik_container_name }}
|
|
|
|
Restart=always
|
|
|
|
RestartSec=15s
|
|
|
|
Type=exec
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|