Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save charlesmarshall/71db923774c7253196aa to your computer and use it in GitHub Desktop.
Save charlesmarshall/71db923774c7253196aa to your computer and use it in GitHub Desktop.
basic website without hard coded port mapping
[Unit]
Description=Example website
After=etcd.service
After=docker.service
[Service]
ExecStop=/usr/bin/bash -l -c "docker stop $image_name ;"
ExecStart=/usr/bin/bash -l -c "docker pull $registry_ip:5000/$image_name ; docker run --rm --name $container_name -p 80 -i $image_name /bin/bash -l -c "service nginx start";"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment