docker 安裝nginx 批量啓動 容器間連接

docker 安裝在這裏就不詳細解說了nginx

安裝nginx web


FROM centosdocker


RUN rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmcentos

RUN yum -y install nginxide


EXPOSE 80rest

ENTRYPOINT nginx && tailf /var/log/nginx/error.logit



docker-compose.yml 進行 服務啓動 掛載連接docker-compose


nginx:class

   p_w_picpath: 'web'yum

   ports:

       - '9900:80'

   links:

       - real_web:real_web

       - real_web2:real_web2

   volumes:

       - /root/webuser:/opt:rw

   restart: always


real_web:

   p_w_picpath: 'web'

   ports:

       - '9901:80'

   restart: always

real_web2:

   p_w_picpath: 'web'

   ports:

      - '9902:80'

   restart: always

相關文章
相關標籤/搜索