Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement