Docker: how to manage development and production settings?
You could mount your custom nginx.conf
into the container in development via e.g. --volume ./nginx/nginx.conf:/etc/nginx/nginx.conf
and simply omit this parameter to docker run
in production.
If using docker-compose, the two options I would recommend are:
Employ the limited support for environment variable interpolation and add something like the following under
volumes
in your container definition:./nginx/nginx.${APP_ENV}.conf:/etc/nginx/nginx.conf