updating receiver for new start script

This commit is contained in:
Jeff Lindsay
2013-06-09 16:08:35 -07:00
parent 7183805508
commit 447ba5c291
3 changed files with 25 additions and 7 deletions

View File

@@ -12,10 +12,10 @@ if [[ -f "$HOME/$1/PORT" ]]; then
OLDID=$(< "$HOME/$1/CONTAINER")
docker kill $OLDID > /dev/null
PORT=$(< "$HOME/$1/PORT")
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "cd /app && ./start")
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "/start web")
echo $ID > "$HOME/$1/CONTAINER"
else
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "cd /app && ./start")
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "/start web")
echo $ID > "$HOME/$1/CONTAINER"
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
echo $PORT > "$HOME/$1/PORT"
@@ -31,4 +31,4 @@ if [[ $DOMAIN ]]; then
else
echo " http://$(hostname -i | cut -d' ' -f3):$PORT"
fi
echo
echo