jackpine / biketag-ios

http://biketag.jackpine.me
1 stars 1 forks source link

restart api/db services automatically #63

Open michaelkirk opened 9 years ago

michaelkirk commented 9 years ago

Processes start on startup, but if the process dies for some reason, restarts are not currently managed - maybe due to system expecting whatever command it runs to represent the foreground process of your services. However, docker start returns as soon as the container is started, it doesn't latch onto the process, thus there is nothing for systemd to monitor.

Maybe related: https://github.com/coreos/fleet/issues/940

michaelkirk commented 8 years ago

CoreOS docs on using systemd: https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/

After glancing over that, I think maybe my problem is that I'm using docker wrong. Maybe I should be using docker run to start a new container rather than stop/starting an existing container.

In order to do this, I'll have to find some way to communicate the env specific configuration data to the container. Currently this is copied into the container during deploy. The two approaches to this that come to mind are:

  1. Do something like what we're doing in the deploy script to copy in the config on every execution of systemctl start biketag-api
  2. Put the config in a volume and mount the volume as part of the docker/run.