docker 安装在这里就不详细解说了
安装nginx
FROM centos
RUN rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
RUN yum -y install nginx
EXPOSE 80
ENTRYPOINT nginx && tailf /var/log/nginx/error.log
docker-compose.yml 进行 服务启动 挂载链接
nginx:
image: ‘web‘
ports:
- ‘9900:80‘
links:
- real_web:real_web
- real_web2:real_web2
volumes:
- /root/webuser:/opt:rw
restart: always
real_web:
image: ‘web‘
ports:
- ‘9901:80‘
restart: always
real_web2:
image: ‘web‘
ports:
- ‘9902:80‘
restart: always
时间: 2024-10-12 03:01:56