Last active
February 27, 2016 01:04
-
-
Save waltervargas/2202864e4e7979234edd to your computer and use it in GitHub Desktop.
upstart job to manage docker-compose and copy a .htaccess file when the apache docker container is up and running.
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
# This job can run docker containers with docker-compose | |
# and copy a file when one of the dockers is available. | |
description "Job to manage docker-compose" | |
author "Walter Vargas <[email protected]> and Juan Mesa <[email protected]>" | |
start on filesystem and started docker | |
stop on runlevel [!2345] | |
respawn | |
script | |
/usr/local/bin/docker-compose -f /etc/app/docker-compose.yml up | |
end script | |
post-start script | |
while ! nc -vz localhost 443 ; do sleep 1 ; done && docker cp /etc/app/htaccess container-name:/path/inside/container/.htaccess | |
end script | |
post-stop script | |
/usr/local/bin/docker-compose -f /etc/app/docker-compose.yml stop | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment