|
|
7 anni fa | |
|---|---|---|
| nginx | 7 anni fa | |
| node | 7 anni fa | |
| .gitignore | 7 anni fa | |
| Dockerfile | 7 anni fa | |
| README.md | 7 anni fa |
From https://www.codeschool.com/screencasts/build-a-node-app-with-postgres-and-docker
Run nginx
docker run -p 81:80 --name web nginxdocker run -p 81:80 --name web --rm nginxdocker run -p 81:80 --name web -d nginxforeground, 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 imagesdocker images -adocker images osinet/nginxcd 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