docker+nginx 部署网页
1. 拉取nginx
pull nginx
2. 新建目录
mkdir /data/docker/nginx/html
mkdir /data/docker/nginx/conf
mkdir /data/docker/nginx/logs
mkdir /data/docker/nginx/ssl
3. 开启一个nginx用来获取基本资料
docker run --name nginx-test nginx
docker cp nginx-test:/etc/nginx/nginx.conf /data/docker/nginx/conf/nginx.conf
docker cp nginx-test:/etc/nginx/conf.d/default.conf /data/docker/nginx/conf/conf.d/default.conf
4. 启动docker容器
docker run -p 9999:80 -p 443:443 --name jks-front \
-d --restart=always \
-v /data/docker/nginx/html:/usr/share/nginx/html:rw \
-v /data/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf/:rw \
-v /data/docker/nginx/conf/conf.d/:/etc/nginx/conf.d/:rw \
-v /data/docker/nginx/logs:/var/log/nginx/:rw \
-v /data/docker/nginx/ssl:/ssl/:rw \
nginx
5. 在html下新建index.html