Skip to content

Instantly share code, notes, and snippets.

@jwerak
Created May 4, 2015 11:12
Show Gist options
  • Save jwerak/f28db0b93120a96ba8d0 to your computer and use it in GitHub Desktop.
Save jwerak/f28db0b93120a96ba8d0 to your computer and use it in GitHub Desktop.
run example pyton app in docker
#!/bin/bash
curl https://gist.githubusercontent.com/veverjak/b8607526f071f296bd8c/raw/52dd97718f1f7e46c5f7d04888ca02c74bea7225/get_file_content.py -o /app.py
pip install flask
while true; do
etcdctl --peers `cat /etc/ip`:4001 get /test > /test
if [[ -n $PID ]];
then kill -9 $PID;
fi
python /app.py /test &
PID=`echo $!`
etcdctl --peers `cat /etc/ip`:4001 watch /test
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment