invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
420 stars 268 forks source link

[Suggestion] Reduce coupling to docker service names #432

Closed yankee14 closed 2 days ago

yankee14 commented 2 years ago

In short, I wanted to rename some of the services in the docker-compose file to something less generic than app, server, and db so as to not pollute my docker service namespace. I tried renaming the services to invoiceninja_app, invoiceninja_server, and invoiceninja_database respectively, but it produces at least a couple errors. One of them is from the server service:

nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/in-vhost.conf:19

It was easy to fix this by editing ./config/nginx/in-vhost.conf and changing app on line 19 to invoiceninja_app.

More errors are coming from the app service, so it must be trying to use the service names somewhere in its associated files, and I'm not sure where the error is coming from.

Suggestion

Reduce the coupling to the service names. Maybe add entries to the env_file, where the entries must match the service names listed in docker-compose.yml? And the various parts of the application can use the environment variables instead of a fixed name.

Steps to Reproduce

  1. Rename service names in the docker-compose.yml file
  2. Observe errors.