Docker package deployment front-end project and load balancing

Set Taobao mirror 
npm install -g CNPM --registry = HTTPS: // registry.npm.taobao.org
 // at home / fn1 home / fn2 project and nginx.conf into 

Docker RUN -it -d --name fn1 - -v /home/fn1/nginx.conf:/etc/nginx/nginx.conf V / Home / Fn1 / Img_facebook-VUE: / Home / Fn1 / VUE --privileged - Net = Img_facebook- Host Nginx 

Docker RUN Expediting IT -d --name fn2 -v /home/fn2/nginx.conf:/etc/nginx/nginx.conf -v / home / fn2 / renren-vue: / home / fn2 / renren-vue --privileged --net = Host Nginx 

Docker RUN Expediting IT -d --name Fn3 /home/fn3/nginx.conf:/etc/nginx/nginx.conf -v -v / Home / Fn3 / Img_facebook-VUE: / Home / Fn3 / renren- - Net = --privileged VUE Host nginx 


then create two nginx for distribution to the front three nginx 

Docker RUN-it -d --name ff1 -v /home/ff1/nginx.conf:/etc/nginx/nginx.conf -v / home / ff1 / renren-vue: / home / ff1 / renren-vue --privileged - = -net Host Nginx 

Docker RUN Expediting IT /home/ff2/nginx.conf:/etc/nginx/nginx.conf -v -v -d --name FF2 / Home / FF2 / Img_facebook-VUE: / Home / FF2 / - Net-VUE --privileged = Img_facebook Host Nginx 

stopped at fn1 load balancing verification 
docker pause fn1 


two hot standby distal project 
Docker Exec - IT FF1 the bash 
APT - GET Update 
APT - GET keepalived the install 
APT - GET the install Vim 

VI / etc / keepalived / keepalived.conf 
Service Start keepalived

 

Guess you like

Origin www.cnblogs.com/shanheyongmu/p/11280701.html