ansible/roles/authentik_docker/templates/authentik-worker-docker.service.j2

27 lines
1.2 KiB
Text
Raw Normal View History

[Unit]
Description=Authentik Worker with Docker
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm --force {{ container_names.authentik.worker }}
ExecStartPre=-/usr/bin/docker pull ghcr.io/goauthentik/server:{{ version.authentik }}
ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.worker }} --user root \
--network authentik_net --expose 9000 --expose 9443 \
--env-file {{ docker_volumes_dir }}/authentik/authentik.env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v {{ docker_volumes_dir }}/authentik/media:/media \
-v {{ docker_volumes_dir }}/authentik/certs:/certs \
-v {{ docker_volumes_dir }}/authentik/custom-templates:/templates \
--label=com.centurylinklabs.watchtower.enable=false \
ghcr.io/goauthentik/server:{{ version.authentik }} worker
2023-11-16 10:55:36 +01:00
ExecStartPost=/usr/bin/bash -c "/bin/sleep 120 && /usr/bin/docker network connect nginx_net {{ container_names.authentik.worker }}"
ExecStop=-/usr/bin/docker stop {{ container_names.authentik.worker }}
Restart=always
RestartSec=60s
2023-11-16 11:09:51 +01:00
TimeoutStartSec=infinity
Type=exec
[Install]
WantedBy=multi-user.target