Docker-compose - custom nginx conf won't persist to container reload

every time the zammad-nginx container is restarted, the init-container reinitialize the configuration of nginx, thus overwriting the my customized “dafault” file configuration. If i use the contrib/nginx/zammad_ssl.conf template beside the default file it gives me an error about duplicated upstream server (both files has one)

I already tried todo a volume mount of nginx\sites-enabled folder in read-only but with no success: init container give an error if it can’t edit the default configuration file

this page is not helping because it talks about a barebone enviroment

the configuration is build on startup, see; zammad-docker-compose/docker-entrypoint.sh at master · zammad/zammad-docker-compose · GitHub
so you’ll have to adopt that, to your own needs

I prefer to not build the images myself (and edit the entrypoint) to preserve the given compose structure for easy future updates, there’s really no other way to do that?

you could run the standard setup, of course, which wouldn’t bring you all these issues. You could overwrite the entrypoint or a new command in your compose file, e.g. command: sed ‘change stuff’ site-enabled/default && entrypoint.sh nginx. Addtionally the nginx.conf includes the whole folder, so you could add another config file with your custom setup, see, in /etc/nginx/nginx.conf;
include /etc/nginx/conf.d/.conf;
include /etc/nginx/sites-enabled/
;

thank you for the suggestion

meanwhile i opened a pull request about this use case

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.