Skip to content

Instantly share code, notes, and snippets.

@pgilad
Last active August 19, 2019 05:43
Show Gist options
  • Save pgilad/82629d3c0099b385ef18dfd554af066a to your computer and use it in GitHub Desktop.
Save pgilad/82629d3c0099b385ef18dfd554af066a to your computer and use it in GitHub Desktop.
Docker Compose Pi3 Applications Service
# File: /etc/systemd/system/docker-compose-opt.service
[Unit]
Description=Docker Compose Opt Service
Requires=docker.service network-online.target
After=docker.service network-online.target
[Service]
WorkingDirectory=/opt/applications
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/local/bin/docker-compose pull --quiet
ExecStart=/usr/local/bin/docker-compose up -d
ExecStop=/usr/local/bin/docker-compose stop
ExecReload=/usr/local/bin/docker-compose pull --quiet
ExecReload=/usr/local/bin/docker-compose up -d
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment