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

53 lines
2.1 KiB
Desktop File

[Unit]
Description=Podman pod-notes-joplin.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-notes.service
After=pod-notes.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-notes-joplin.pid %t/pod-notes-joplin.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/pod-notes-joplin.pid \
--cidfile %t/pod-notes-joplin.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-notes.pod-id \
--replace \
--label "io.containers.autoupdate=image" \
--log-driver=journald \
-dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v ./.config/service/hosts:/etc/hosts:ro \
-v {{ services_data_directory }}/pod-notes/data/_data:/data:U \
-e APP_BASE_URL="https://{{ services[services_service_name].domain }}" \
-e APP_PORT="22300" \
-e DB_CLIENT="pg" \
-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 }}" \
-e POSTGRES_PORT="5432" \
-e POSTGRES_HOST="pod-database" \
-e MAILER_ENABLED="true" \
-e MAILER_HOST="{{ services[services_service_name].smtp.host }}" \
-e MAILER_PORT=465 \
-e MAILER_SECURITY="tls" \
-e MAILER_AUTH_USER="{{ services[services_service_name].smtp.user }}" \
-e MAILER_AUTH_PASSWORD="{{ services[services_service_name].smtp.password }}" \
-e MAILER_NOREPLY_NAME="Joplin" \
-e MAILER_NOREPLY_EMAIL="noreply@{{ services[services_service_name].domain }}" \
-e STORAGE_DRIVER="Type=Filesystem; Path=/data" \
--name=pod-notes-joplin \
docker.io/joplin/server:{{ services_service_deploy_versions.joplin }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/pod-notes-joplin.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/pod-notes-joplin.ctr-id
PIDFile=%t/pod-notes-joplin.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target