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

53 lines
2.9 KiB
Desktop File

[Unit]
Description=Podman container-notes-joplin.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-notes.service
Requires=container-notes-chown.service
After=pod-notes.service container-notes-chown.service
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 \
--add-host=pod-database:{{ services_all_services['database'].address }} \
-v {{ services_root_directory }}/{{ services_resolv_host }}-resolv.conf:/etc/resolv.conf:ro \
-v {{ services_data_directory }}/pod-notes/data/_data:/data \
-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="notes@{{ 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/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