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

21 lines
757 B
Text
Raw Permalink Normal View History

[Unit]
Description=Postgres for Authentik with Docker
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm --force {{ container_names.authentik.db }}
ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.db }} --network authentik_net \
--env-file {{ docker_volumes_dir }}/authentik/authentik.env --expose 5432 \
-v {{ docker_volumes_dir }}/authentik/database:/var/lib/postgresql/data \
--label=com.centurylinklabs.watchtower.enable=false \
docker.io/library/postgres:{{ authentik_postgres_version }}
ExecStop=-/usr/bin/docker stop {{ container_names.authentik.db }}
Restart=always
RestartSec=30s
TimeoutStartSec=30s
Type=exec
[Install]
WantedBy=multi-user.target