2023-09-13 18:03:24 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Authentik Worker with Docker
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStartPre=-/usr/bin/docker rm --force {{ container_names.authentik.worker }}
|
2023-09-15 21:22:16 +02:00
|
|
|
ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.worker }} --user root \
|
|
|
|
--network authentik_net --expose 9000 --expose 9443 \
|
2023-09-13 18:03:24 +02:00
|
|
|
--env-file {{ docker_volumes_dir }}/authentik/authentik.env \
|
2023-09-15 21:22:16 +02:00
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
2023-09-13 18:03:24 +02:00
|
|
|
-v {{ docker_volumes_dir }}/authentik/media:/media \
|
|
|
|
-v {{ docker_volumes_dir }}/authentik/certs:/certs \
|
|
|
|
-v {{ docker_volumes_dir }}/authentik/custom-templates:/templates \
|
2023-09-15 21:22:16 +02:00
|
|
|
ghcr.io/goauthentik/server:{{ version.authentik }} worker
|
2023-09-13 18:03:24 +02:00
|
|
|
ExecStartPost=/usr/bin/bash -c "/bin/sleep 10 && /usr/bin/docker network connect nginx_net {{ container_names.authentik.worker }}"
|
2023-09-15 21:44:43 +02:00
|
|
|
ExecStop=-/usr/bin/docker stop {{ container_names.authentik.worker }}
|
2023-09-13 18:03:24 +02:00
|
|
|
Restart=always
|
2023-09-15 21:37:11 +02:00
|
|
|
RestartSec=60s
|
|
|
|
TimeoutRestartSec=60s
|
2023-09-13 18:03:24 +02:00
|
|
|
Type=exec
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|