Skip to content

Instantly share code, notes, and snippets.

@kuu
Last active November 18, 2016 00:54
Show Gist options
  • Save kuu/ce42eeb497dcd668b72ae4a0a0187ae3 to your computer and use it in GitHub Desktop.
Save kuu/ce42eeb497dcd668b72ae4a0a0187ae3 to your computer and use it in GitHub Desktop.

Setup

Each of us runs six servers on a single local machine, so that we can show responsive demos. Below are the instructions on how to run the servers locally.

#/bin/sh
docker run -d -p 2345:5432 --name=postgres postgres
docker run -d -p 3000:3000 --name player-demo kuuu/interbee-2016-player-demo
docker run -d -p 12550:12550 --name discovery-demo kuuu/interbee-2016-discovery-demo
docker run -d -p 3002:3002 --name live-demo kuuu/interbee-2016-live-demo
sleep 5
docker exec -it postgres su -c "createuser vet_client && createdb solution_demos" -s /bin/sh postgres
docker run -d -p 12600:12600 --link postgres:db --name=solution-be kuuu/interbee-2016-solution-be
docker run -d -p 1337:1337 --link solution-be:backend --name=solution-fe kuuu/interbee-2016-solution-fe
  • Run the above script (takes a few minutes.)
$ chmod a+x run.sh
$ ./run.sh
  • Add the following line to /etc/hosts (needed for FB app domain)
127.0.0.1	interbee-2016.my-demo.link

Clean up

  • (If you don't need the servers any more, ) Save the following script as kill.sh
#/bin/sh
docker stop solution-fe ; docker rm solution-fe
docker stop solution-be ; docker rm solution-be
docker stop live-demo ; docker rm live-demo
docker stop discovery-demo ; docker rm discovery-demo
docker stop player-demo ; docker rm player-demo
docker stop postgres ; docker rm postgres
  • Run the above script (takes a few minutes.)
$ chmod a+x kill.sh
$ ./kill.sh

Partial update

By issuing the follwoing commands, only Live demo will be updated:

$ ./kill.sh
$ docker pull kuuu/interbee-2016-live-demo
$ ./run.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment