2021-01-13 16:36:50 +00:00
|
|
|
[Unit]
|
|
|
|
Description=MariaDB SQL Database
|
2021-06-27 11:52:47 +00:00
|
|
|
Wants=container-build@%N.service
|
|
|
|
After=container-build@%N.service
|
2021-01-13 16:36:50 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Restart=always
|
|
|
|
EnvironmentFile=/etc/container-service/%N/%N.env
|
2021-06-27 11:52:47 +00:00
|
|
|
ExecStart=/bin/podman run --replace --pull never --name %N --net internal \
|
|
|
|
--env-file /etc/container-service/%N/%N.env \
|
|
|
|
--volume %N:/var/lib/mysql:z \
|
|
|
|
localhost/%N:latest
|
|
|
|
ExecStartPost=/bin/podman run --replace --pull never --rm --name %N-wait --net internal \
|
|
|
|
--volume %N:/var/lib/mysql:z \
|
|
|
|
--entrypoint mariadb-admin localhost/%N:latest \
|
2021-01-13 16:36:50 +00:00
|
|
|
--host mariadb --user root --password=${MYSQL_ROOT_PASSWORD} --wait=10 ping
|
|
|
|
ExecStop=/bin/podman stop --time 10 %N
|
2021-03-27 23:03:56 +00:00
|
|
|
ExecStopPost=/bin/podman rm --force %N
|
2021-01-13 16:36:50 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|