restart nginx container when upstream servers is updated

前端 未结 4 891
情歌与酒
情歌与酒 2020-12-24 13:48

I want to add/remove servers in my nginx running inside a docker container

I use ADD command in Dockerfile to add my nginx.conf to /etc/nginx dir.

#          


        
4条回答
  •  無奈伤痛
    2020-12-24 14:51

    If you want to do this from within a container, you will need service/configuration discovery. Tools like coreOS/etcd and Apache Zookeeper are made to facilitate this process. Fair warning: for simple applications, these can be a bit difficult to manage.

    There is also docker-gen, which is somewhat easier to get going. There is even a specific pre-made script for exactly the scenario you are describing.

提交回复
热议问题