Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
Created January 22, 2021 17:18
Show Gist options
  • Save dallasmarlow/82e85b505078dba2eb3f88912ebad564 to your computer and use it in GitHub Desktop.
Save dallasmarlow/82e85b505078dba2eb3f88912ebad564 to your computer and use it in GitHub Desktop.
[Unit]
Description=example service_a
After=docker.service
[Service]
TimeoutStartSec=5m
User=deamon
Restart=always
RestartSec=30s
ExecStartPre=-/bin/bash -c "exec /usr/bin/docker pull service_a:latest"
ExecStartPre=-/usr/bin/docker rm -f service_a
ExecStart=/bin/bash -c "PATH=$PATH:/opt/bin exec /usr/bin/docker run --name service_a service_a:latest"
ExecStop=-/usr/bin/docker kill service_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment