Skip to content

Instantly share code, notes, and snippets.

@Mambix
Created October 3, 2018 14:37
Show Gist options
  • Save Mambix/3c16a1b8c8dd11f10414186368e795d6 to your computer and use it in GitHub Desktop.
Save Mambix/3c16a1b8c8dd11f10414186368e795d6 to your computer and use it in GitHub Desktop.
# /etc/systemd/system/docker-compose-app.service
# systemctl enable docker-compose-app
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
WorkingDirectory=/srv/docker
ExecStart=/usr/local/bin/docker-compose start
ExecStop=/usr/local/bin/docker-compose stop
TimeoutStartSec=0
Restart=on-failure
StartLimitIntervalSec=60
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
@Mambix
Copy link
Author

Mambix commented Oct 3, 2018

Change the WorkingDirectory parameter with your dockerized project path. And enable the service to start automatically:

systemctl enable docker-compose-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment