how to run nginx docker container with custom config?

前端 未结 3 474
误落风尘
误落风尘 2020-12-29 03:36

I have a Dockerfile and custom nginx configuration file (in the same directory with Dockerfile) as follows:

Dockerfile:

FROM nginx

COPY nginx.conf /         


        
3条回答
  •  轮回少年
    2020-12-29 04:07

    official nginx docker hub manual page:

    docker run --name my-custom-nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
    

提交回复
热议问题