Last active
August 29, 2015 14:01
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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