ansible-edda/playbooks/roles/services/deploy/database/templates/systemd/container-database-postgres.service

39 lines
1.9 KiB
Desktop File

[Unit]
Description=Podman container-database-postgres.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-database.service
After=pod-database.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-database-postgres.pid %t/container-database-postgres.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-database-postgres.pid \
--cidfile %t/container-database-postgres.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-database.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/database.password:/run/secrets/database.password:ro \
-e POSTGRES_PASSWORD_FILE=/run/secrets/database.password \
-v {{ services_data_directory }}/pod-database/wal/_data:/var/lib/postgresql-wal \
-e POSTGRES_INITDB_WALDIR=/var/lib/postgresql-wal \
-v {{ services_data_directory }}/pod-database/data/_data:/var/lib/postgresql/data \
--name=pod-database-postgres \
docker.io/library/postgres:{{ services_service_deploy_versions.postgres }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-database-postgres.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-database-postgres.ctr-id
PIDFile=%t/container-database-postgres.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target