美文网首页IT技术篇
docker安装nginx配置

docker安装nginx配置

作者: 王滕辉 | 来源:发表于2020-09-16 10:22 被阅读0次
    docker pull nginx
    
    ># management
    docker run --name nginx-manager -d nginx
    docker cp nginx-manager:/etc/nginx/conf.d/default.conf /home/java/management/conf/default.conf
    docker cp nginx-manager:/etc/nginx/nginx.conf /home/java/management/nginx.conf
    docker cp nginx-manager:/var/log/nginx /home/java/management/
    mv /home/java/management/nginx /home/java/management/logs 
    docker cp nginx-manager:/usr/share/nginx/html /home/java/management/
    docker rm -f nginx-manager
    
    docker run --name nginx-manager -p 8081:80 --network my-net \
               -v /home/java/management/html:/usr/share/nginx/html \
               -v /home/java/management/nginx.conf:/etc/nginx/nginx.conf \
               -v /home/java/management/conf/default.conf:/etc/nginx/conf.d/default.conf \
               -v /home/java/management/logs:/var/log/nginx  nginx
    

    相关文章

      网友评论

        本文标题:docker安装nginx配置

        本文链接:https://www.haomeiwen.com/subject/ekscyktx.html