Manage nginx configuration in Dockerfile/entrypoint.sh with the new built-in templating of the nginx image?
Nginx image versions from 1.19 onward have support for built-in templating, see "Using environment variables in nginx configuration (new in 1.19)" in https://hub.docker.com/_/nginx.
This could be used to replace the rather complex templating done with sed in entrypoint.sh. Just copy the desired configuration files to /etc/nginx/templates, add a ".template" suffix to them and use environment variables in the with ${myvar} them.
I agree, this would be a great improvement! A pull request would be very welcome.
Side note: At the moment I'm thinking about whether nginx should be part of the image at all. The image build from docker/Dockerfile.slim has been tested successfully and might be the way to go.
I agree, this would be a great improvement! A pull request would be very welcome.
Ok, I'll look into it!
Side note: At the moment I'm thinking about whether nginx should be part of the image at all. The image build from docker/Dockerfile.slim has been tested successfully and might be the way to go.
I suppose nginx is not really needed for development setups. My production setup has nginx + letsencrypt, so there it makes sense.