Created
July 27, 2019 01:44
-
-
Save rayspock/a62c2aeb61fb93d090b99744f515188a to your computer and use it in GitHub Desktop.
Service Unit Configuration for Docker
This file contains 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
[Unit] | |
Description=Rapid Issuer Process | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Restart=always | |
User=ubuntu | |
Group=docker | |
Environment=DOCKER_COMPOSE=/home/ubuntu/build/watch/docker-compose.yml | |
# Shutdown container (if running) when unit is stopped | |
ExecStartPre=/usr/bin/docker-compose -f ${DOCKER_COMPOSE} down -v | |
# Start container when unit is started | |
ExecStart=/usr/bin/docker-compose -f ${DOCKER_COMPOSE} up | |
# Stop container when unit is stopped | |
ExecStop=/usr/bin/docker-compose -f ${DOCKER_COMPOSE} down -v | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment