Use docker stop in systemd services

master
Hugo Peixoto 8 months ago
parent 4c05a03f93
commit b3b8aeaedb
  1. 3
      roles/container-postgres/files/unit.service
  2. 3
      roles/container-saucy/files/unit.service

@ -6,7 +6,8 @@ After=network-online.target
[Service]
Restart=on-failure
TimeoutStopSec=70
ExecStart=/usr/bin/docker run --rm -it --name postgres --env-file /srv/postgres/env -v /srv/postgres/data:/var/lib/postgresql/data -p5432:5432 postgres:latest
ExecStart=/usr/bin/docker run --rm --name postgres --env-file /srv/postgres/env -v /srv/postgres/data:/var/lib/postgresql/data -p5432:5432 postgres:latest
ExecStop=/usr/bin/docker stop postgres
[Install]
WantedBy=multi-user.target default.target

@ -6,7 +6,8 @@ After=network-online.target container-postgres.service
[Service]
Restart=on-failure
TimeoutStopSec=70
ExecStart=/usr/bin/docker run --pull=always --rm -it --name saucy --env-file /srv/saucy/env -v /srv/saucy/data:/data -p80:3000 git.ansol.org/ansol/saucy:latest
ExecStart=/usr/bin/docker run --pull=always --rm --name saucy --env-file /srv/saucy/env -v /srv/saucy/data:/data -p80:3000 git.ansol.org/ansol/saucy:latest
ExecStop=/usr/bin/docker stop saucy
[Install]
WantedBy=multi-user.target default.target

Loading…
Cancel
Save