This project shows in a simple example how to enable systemd control for your podman containers. It is intended as a template for more complex setups.
The idea for this repository came to me from reading this excellent blog post from my colleague Valentin Rothberg.
The idea about healthchecks came from this (slightly outdated) blog post by my colleague Brent Baude.
Howto
Ensure that you run this with a user that can control systemctl, then just build the example container with:
Install it with:
And then you can control it with:
$ systemctl enable simpleserver
$ systemctl start simpleserver
$ systemctl stop simpleserver
Testing
You can see the start page at localhost:8080 and the metrics at localhost:8080/server-status.