subzerocloud / postgrest-starter-kit

Starter Kit and tooling for authoring REST API backends with PostgREST
MIT License
745 stars 71 forks source link

in docker-compose set hostname and ports from .env settings #10

Closed ilkosta closed 5 years ago

ilkosta commented 7 years ago

with these settings the user can run multiple dev environments and decouple the hostname from the service name inside the network.

I'm a newbie approaching your project and it seems great! Thank you

ruslantalpa commented 7 years ago

I understand the logic of different ports for different projects, is it that common, big inconvenience to shut down one stack and bring up the other one? Can you give a bit more detail how this became an issue for you?

With the ports, at least one thing i see that breaks with this pr is this: I wanted the user to be able to swap the database by changing the .env settings (and comment the db section) and have the rest of the components connect to his db (wherever it is, probably on localhost). With the changes in this PR, it's assumed the database will always be at port 5432.

I've never used hostname. How is this setting helpful?

Thank you

ilkosta commented 7 years ago

Thanks now I understand the motivation behind the DB_PORT env. You can easily pull off the PR.

For the hostname, inside the network, each service have the hostname set by default as the service name... looking around the code, i see that the hostnames are not used, so seems not necessary to decouple .env hostname from service name.

again you can trash the PR.