Skip to content

Instantly share code, notes, and snippets.

@georgeyord
Last active August 29, 2015 14:01
Show Gist options
  • Save georgeyord/07b4c7f0285965faa81e to your computer and use it in GitHub Desktop.
Save georgeyord/07b4c7f0285965faa81e to your computer and use it in GitHub Desktop.
Use a docker image to run angular tutorial (https://docs.angularjs.org/tutorial) the easiest way
# Check out locally the app from Git
git clone --depth=14 https://github.com/angular/angular-phonecat.git
# Build and run the docker image, log in with bash to run the initialization command (it will take some time)
docker run -it --rm -p 8000:8000 -v [absolute path to angular-phonecat]:/data dockerfile/nodejs bash
# When logged in the container
npm install && npm install -g bower && bower --allow-root install && npm start
# When complete check it in browser
http://localhost:8000/app/index.html
# In the container hit Ctrl+C and exit to stop the container start the container again using the command in 'start.sh'
# Run the container to start the local server:
docker run -d -p 8000:8000 --name=phonecat -v [absolute path to angular-phonecat]:/data dockerfile/nodejs npm start
# Stop the container
docker stop phonecat
# Remove the container
docker rm phonecat
# Check the logs in the container
docker logs -f phonecat
# Check it in browser:
http://localhost:8000/app/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment