单nginx

  1. docker pull nginx

在宿主机中目录/home/n1/ 上传nginx.conf,这样方便映射到容器内的配置

启动第1个nginx节点

  1. docker run -p 80:80 -it -d --name nginx1 -v /data/nginx/nginx.conf:/etc/nginx/nginx.conf -v /data/renren-cloud-admin:/data/renren-cloud-admin --privileged nginx
  2. docker run -p 80:80 -it -d --name nginx1 --privileged nginx
  3. sudo docker exec -it nginx1 /bin/bash -c 'cat /etc/nginx/nginx.conf'
  4. docker run -it -d --name n1 -v /data/nginx/nginx.conf:/etc/nginx/nginx.conf --net=host --privileged nginx

容器运行,代表nginx也被启动了

scp -r /Users/silver/dev/project/renren/renren-cloud-tenant-admin/dist/* root@47.111.15.10:/data/renren-cloud-admin