otterwiki icon indicating copy to clipboard operation
otterwiki copied to clipboard

Manage nginx configuration in Dockerfile/entrypoint.sh with the new built-in templating of the nginx image?

Open mattock opened this issue 1 year ago • 2 comments

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.

mattock avatar Sep 24 '24 09:09 mattock

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.

redimp avatar Sep 25 '24 08:09 redimp

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.

mattock avatar Sep 27 '24 10:09 mattock