Docker: how to manage development and production settings?

I'm just starting with Docker. With the official NGINX image on my OSX development machine (with the Docker Machine as the Docker node), I ran into an error with sendfileVirtualBox, which means that the server does not show the changes made to the files.

A workaround for this is to use the modified nginx.conf file, which is disabled sendfile. This guy solution has instructions in the Docker file for copying the configured conf file to the container. Alternatively, this guy maps the NGINX configuration to a new folder with the modified conf file.

This type of work works well on site. But what if I don't need this modification on my cloud host? How should I handle these and other deployment differences?

+4
source share
1 answer

You can connect your own nginx.confto the container in development through, for example, --volume ./nginx/nginx.conf:/etc/nginx/nginx.confand simply omit this parameter docker runin the production process.

If you are using docker-compose , there are two options that I would recommend:

+5

Source: https://habr.com/ru/post/1622609/


All Articles