Is it ok to use systemd service to run docker-compose up? Seems like cheating to systemd. I wish I could manage docker containers directly with systemd services.
@sam You can manage container using systemd, but I would recommend to use podman instead of docker.
No worries, you can use the same commands, podman just works without a daemon like dockerd.
An example can be found here: https://semjonov.de/post/2018-11/managing-containers-with-podman-and-systemd/
If you really want to use docker: Don't mix docker commands with systemd services. Use docker's `--restart` feature instead which will manage the state as soon as systemd started dockerd. Otherwise you will only meet quite ugly problems.
@sheogorath Thanks for the detailed explanation and advice. I will take a look now. For ease of configuration I am using docker-compose right now. Does podman have a similar thing?
@sam Not exactly. That's what systemd is used for. Configurations can be managed by environment files as in docker-compose.
There is, of course, also the concept of pods, which you might know from K8s, but I neither use K8s nor podman in that way, that I could give practical hints here.
@sam eh, systemd does everything these days anyway, one more function wont make a difference.