coreos-home-server/config/service/mariadb/systemd/mariadb.service

22 lines
739 B
SYSTEMD
Raw Normal View History

[Unit]
Description=MariaDB SQL Database
Wants=container-build@%N.service container-volume@%N.service
After=container-build@%N.service container-volume@%N.service
[Service]
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
ExecStart=/bin/podman run --replace --name %N --net internal \
--env-file %E/coreos-home-server/%N/%N.env \
--volume %N:/var/lib/mysql:z \
--health-cmd 'mariadb-admin -uroot -p$MYSQL_ROOT_PASSWORD ping' \
localhost/%N:latest
ExecStop=/bin/podman stop --ignore --time 10 %N
ExecStopPost=/bin/podman rm --ignore --force %N
[Install]
WantedBy=multi-user.target