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
Rename service names in the docker-compose.yml file
In short, I wanted to rename some of the services in the docker-compose file to something less generic than
app
,server
, anddb
so as to not pollute my docker service namespace. I tried renaming the services toinvoiceninja_app
,invoiceninja_server
, andinvoiceninja_database
respectively, but it produces at least a couple errors. One of them is from theserver
service:It was easy to fix this by editing
./config/nginx/in-vhost.conf
and changingapp
on line 19 toinvoiceninja_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
docker-compose.yml
file