Oneshot podman container

I am deploying a Mastodon instance using podman containers on my NixOS system. There is one container that just runs the database migrations and is a dependency of the main web, streaming, and sidekiq containers. The reason it’s a container is because the migration script requires the whole context of the mastodon environment.

What I’d like it to do is just run once, and only restart if the migration failed. I can’t seem to find options within podman or systemd that will stop it from getting restarted every time it finishes. So far, the only thing I tried was setting Restart = "on-failure" in the systemd service for the migration container.

Ideas?

Thanks all!

Figured it out; I also had to set Type = "oneshot"; on the systemd unit for that podman container.