In most cases docker is not the correct solution. I’m pretty sure that writing a proper systemd unit or initscript (depends on what init system you use) is usually the cleaner and better solution to this problem. Also wrapping it in a proper package for the target system is usually much better than a docker service.
Docker is only really a thing if you want to deploy using kubernetes or into swarms or other kind of cloudstuff.