ansible-edda/playbooks/roles/services/deploy/cloud/templates/systemd/container-cloud-nextcloud.service

55 lines
3.1 KiB
SYSTEMD
Raw Normal View History

2022-11-03 00:25:43 +01:00
[Unit]
Description=Podman container-cloud-nextcloud.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-cloud.service
2023-04-08 09:24:47 +02:00
Requires=container-cloud-chown.service
After=pod-cloud.service container-cloud-chown.service
2022-11-03 00:25:43 +01:00
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-cloud-nextcloud.pid %t/container-cloud-nextcloud.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-cloud-nextcloud.pid \
--cidfile %t/container-cloud-nextcloud.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-cloud.pod-id \
--replace \
--label "io.containers.autoupdate=image" \
-dt \
2022-12-16 23:57:38 +01:00
--add-host=pod-database:{{ services_all_services['database'].address }} \
2023-02-12 19:37:33 +01:00
-v {{ services_root_directory }}/{{ services_resolv_host }}-resolv.conf:/etc/resolv.conf:ro \
2022-12-18 00:05:58 +01:00
-v {{ services_data_directory }}/pod-cloud/nextcloud/_data:/var/www/html \
-v {{ services_data_directory }}/pod-cloud/data/_data:/var/www/html/data \
2023-04-08 09:24:47 +02:00
-v {{ services_data_directory }}/pod-cloud/external/_data:/media/external \
-v ./.config/service/database.name:/run/secrets/database.name:ro \
-v ./.config/service/database.user:/run/secrets/database.user:ro \
-v ./.config/service/database.password:/run/secrets/database.password:ro \
2022-11-03 22:02:47 +01:00
-e POSTGRES_HOST=pod-database:5432 \
-e POSTGRES_DB_FILE=/run/secrets/database.name \
-e POSTGRES_USER_FILE=/run/secrets/database.user \
-e POSTGRES_PASSWORD_FILE=/run/secrets/database.password \
2022-12-16 23:57:38 +01:00
-e NEXTCLOUD_TRUSTED_DOMAINS="{{ services[services_service_name].domain }}" \
2022-11-03 22:02:47 +01:00
-e OVERWRITEPROTOCOL="https" \
2023-07-08 15:34:11 +02:00
-e SMTP_HOST="{{ services[services_service_name].smtp.host }}" \
2022-11-03 22:02:47 +01:00
-e SMTP_SECURE="ssl" \
-e SMTP_PORT=465 \
-e SMTP_AUTHTYPE="PLAIN" \
2023-07-08 15:34:11 +02:00
-e SMTP_NAME="{{ services[services_service_name].smtp.user }}" \
-e SMTP_PASSWORD="{{ services[services_service_name].smtp.password }}" \
2022-11-03 22:02:47 +01:00
-e MAIL_FROM_ADDRESS="cloud" \
2022-12-16 23:57:38 +01:00
-e MAIL_DOMAIN="{{ services[services_service_name].domain }}" \
2022-11-03 00:25:43 +01:00
--name=pod-cloud-nextcloud \
docker.io/library/nextcloud:{{ services_service_deploy_versions.nextcloud }}
2022-11-03 00:25:43 +01:00
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-cloud-nextcloud.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-cloud-nextcloud.ctr-id
PIDFile=%t/container-cloud-nextcloud.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target