ansible-collection-nextcloud/roles/nextcloud/templates/systemd/container-nextcloud-app.service.j2
Nis Wechselberg 4ee5aacf61
Initial version of nextcloud collection
Signed-off-by: Nis Wechselberg <enbewe@enbewe.de>
2024-06-30 17:18:49 +02:00

49 lines
1.4 KiB
Django/Jinja

[Unit]
Description=Podman container-nextcloud-app.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
After=container-nextcloud-db.service
After=container-nextcloud-redis.service
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
Type=notify
NotifyAccess=all
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
--cidfile=%t/%n.ctr-id \
--cgroups=no-conmon \
--rm \
--sdnotify=conmon \
--replace \
--network={{ nextcloud_podman_network }} \
--detach \
--tty \
--publish {{ nextcloud_app_listen_port }}:80 \
--volume {{ nextcloud_app_volume }}:/var/www/html:Z \
--volume /etc/nextcloud/oidc.config.php:/docker-entrypoint-hooks.d/before-starting/oidc.config.php:Z \
--volume /etc/nextcloud/ansible.config.php:/docker-entrypoint-hooks.d/before-starting/ansible.config.php:Z \
--volume /etc/nextcloud/copy_config.sh:/docker-entrypoint-hooks.d/before-starting/copy_config.sh:Z \
{% for environment in nextcloud_app_environments %}
--env {{ environment.key }}={{ environment.value }} \
{% endfor %}
--name={{ nextcloud_app_container_name }} \
{{ nextcloud_app_image_name }}:{{ nextcloud_app_image_tag }}
ExecStop=/usr/bin/podman stop \
--ignore \
--cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm \
--force \
--ignore \
--cidfile=%t/%n.ctr-id
[Install]
WantedBy=default.target