Created
September 2, 2015 19:00
-
-
Save willscripted/68670640648d0bae8574 to your computer and use it in GitHub Desktop.
docker upstart example
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=Documentation for my app | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Environment="PROJECT_API_URL=https://path.to.place.com" | |
ExecStartPre=-/usr/bin/docker kill myapp | |
ExecStartPre=-/usr/bin/docker rm myapp | |
ExecStartPre=-/usr/bin/docker pull quay.io/will_ob/myrepo:production-current | |
ExecStart=/bin/bash -c "/usr/bin/docker run -P \ | |
--name myapp \ | |
-e PROJECT_API_URL=$PROJECT_API_URL \ | |
quay.io/will_ob/myrepo:production-current" | |
ExecStop=/usr/bin/docker stop myapp | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment