Last active
April 10, 2019 09:50
-
-
Save kovalbogdan95/e5523e41a7e1b53bc7f1b889f4d4486f to your computer and use it in GitHub Desktop.
Run docker-compose app as systemd service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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