choi3179 / docker-nginx-vhost

0 stars 0 forks source link

Docker nginx V-host

๐Ÿ’กV-host - nginx image

Container

$ sudo docker run -itd -p 8001:80 --name lb nginx
$ sudo docker run -itd -p 8002:80 --name serv-a nginx
$ sudo docker run -itd -p 8003:80 --name serv-b nginx

lb

๐Ÿ’กV-host - Dockerfile

Dockerfile

Image build

Container

$ docker run --name serv-a -d -p 9001:80 n-s-1:0.1.0
$ docker run --name serv-b -d -p 9002:80 n-s-2:0.1.0
$ docker run --name lb -d -p 8001:80 lb:0.1.0

โœ…Network Connect

Create

$ docker network create DockerfileNet

Connect

$ docker network connect DockerfileNet serv-a
$ docker network connect DockerfileNet serv-b
$ docker network connect DockerfileNet lb

Connection check

$ docker network inspect DockerfileNet

๐Ÿ“ข์‹คํ–‰๊ฒฐ๊ณผ