Last active
August 29, 2015 14:22
-
-
Save leandrocp/6713a79382f3898cf512 to your computer and use it in GitHub Desktop.
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
[Unit] | |
Description=nginx | |
[Service] | |
ExecStartPre=docker pull nginx | |
ExecStart=docker run --name nginx --rm -p %1:80 nginx | |
ExecStartPost=etcdctl set /services/nginx ${COREOS_PUBLIC_IPV4}:%i | |
ExecStop=/usr/bin/docker kill nginx | |
ExecStopPost=/usr/bin/etcdctl rm /services/nginx | |
# %i => substituido pelo valor após o @, no caso valor 80 | |
# ${COREOS_PUBLIC_IPV4} => IP público do servidor | |
# Registrar o service no cluster => fleetctl submit nginx.service | |
# Iniciar o service em um host do cluster => fleetctl start nginx.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment