ansible-edda/playbooks/roles/services/deploy/notes/templates/systemd/container-notes-joplin.service

53 lines
2.9 KiB
SYSTEMD
Raw Normal View History

2022-11-20 15:10:07 +01:00
[Unit]
Description=Podman container-notes-joplin.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-notes.service
2022-11-20 18:09:44 +01:00
Requires=container-notes-chown.service
After=pod-notes.service container-notes-chown.service
2022-11-20 15:10:07 +01:00
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-notes-joplin.pid %t/container-notes-joplin.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-notes-joplin.pid \
--cidfile %t/container-notes-joplin.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-notes.pod-id \
--replace \
--label "io.containers.autoupdate=image" \
-dt \
2022-12-17 00:15:10 +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-notes/data/_data:/data \
2022-12-17 00:15:10 +01:00
-e APP_BASE_URL="https://{{ services[services_service_name].domain }}" \
2022-11-20 15:10:07 +01:00
-e APP_PORT="22300" \
-e DB_CLIENT="pg" \
2023-07-08 15:34:11 +02:00
-e POSTGRES_PASSWORD="{{ services[services_service_name].database.password }}" \
-e POSTGRES_DATABASE="{{ services[services_service_name].database.name }}" \
-e POSTGRES_USER="{{ services[services_service_name].database.user }}" \
2022-11-20 15:10:07 +01:00
-e POSTGRES_PORT="5432" \
-e POSTGRES_HOST="pod-database" \
2022-11-20 18:09:44 +01:00
-e MAILER_ENABLED="true" \
2023-07-08 15:34:11 +02:00
-e MAILER_HOST="{{ services[services_service_name].smtp.host }}" \
2022-11-20 18:09:44 +01:00
-e MAILER_PORT=465 \
-e MAILER_SECURITY="tls" \
2023-07-08 15:34:11 +02:00
-e MAILER_AUTH_USER="{{ services[services_service_name].smtp.user }}" \
-e MAILER_AUTH_PASSWORD="{{ services[services_service_name].smtp.password }}" \
2022-11-21 23:13:50 +01:00
-e MAILER_NOREPLY_NAME="Joplin" \
2022-12-17 00:15:10 +01:00
-e MAILER_NOREPLY_EMAIL="notes@{{ services[services_service_name].domain }}" \
2022-11-20 15:10:07 +01:00
-e STORAGE_DRIVER="Type=Filesystem; Path=/data" \
--name=pod-notes-joplin \
2022-12-17 00:15:10 +01:00
docker.io/joplin/server:{{ services_deploy_versions.notes.joplin }}
2022-11-20 15:10:07 +01:00
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-notes-joplin.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-notes-joplin.ctr-id
PIDFile=%t/container-notes-joplin.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target