Skip to content

Instantly share code, notes, and snippets.

@kovalbogdan95
Last active April 10, 2019 09:50
Show Gist options
  • Save kovalbogdan95/e5523e41a7e1b53bc7f1b889f4d4486f to your computer and use it in GitHub Desktop.
Save kovalbogdan95/e5523e41a7e1b53bc7f1b889f4d4486f to your computer and use it in GitHub Desktop.
Run docker-compose app as systemd service
# sudo nano /etc/systemd/system/docker-app.service
# sudo systemctl daemon-reload
# sudo systemctl status docker-app
[Unit]
Description=Docker Compose App
Requires=docker.service
After=docker.service
[Service]
Restart=always
WorkingDirectory=/home/path/to/project
ExecStart=/usr/local/bin/docker-compose up
ExecStop=/usr/local/bin/docker-compose stop
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment