From https://www.codeschool.com/screencasts/build-a-node-app-with-postgres-and-docker
Run nginx
docker run -p 81:80 --name web nginx
docker run -p 81:80 --name web --rm nginx
docker run -p 81:80 --name web -d nginx
foreground, mounting the nginx/html directory:
docker run --rm \
-p 81:80 \
--name web \
--mount type=bind,source=$PWD/nginx/html,target=/usr/share/nginx/html \
nginx
Enter the container:
docker exec -it web /bin/bash
Build a local image from the Dockerfile
docker build -t osinet/nginx:latest .
Run the newly built image:
docker run --rm \
-p 81:80 \
--name web \
--mount type=bind,source=$PWD/nginx/html,target=/usr/share/nginx/html \
osinet/nginx
List images
docker images
docker images -a
docker images osinet/nginx
cd nginx/node
docker build -t node-app .
docker run -p 8888:8888 \
-v $PWD/node/src:/usr/src/app/src \
--name voting-node \
node-app