hackoregon / transportation-system-backend

2018 repo for the transportation api backend
MIT License
8 stars 2 forks source link

Can't connect from Django container to PostGIS container #18

Closed znmeb closed 6 years ago

znmeb commented 6 years ago

I'm pretty sure this is just a documentation / environment variable problem; I can connect manually from the command line in the Django container using psql.

BrianHGrant commented 6 years ago

I agree documenting the pattern will help. We may want to look at a reactor as well, as discussed in pull request #14

znmeb commented 6 years ago

Does the Django code retry connecting? It's possibly trying to connect before the PostgreSQL container is ready.

bhgrant8 commented 6 years ago

'Depends_on' only waits for container to be running, not that it is ready. Was looking at this a bit earlier today:

https://docs.docker.com/compose/startup-order/

@kiniadit had some new comments in slack so lets see at meeting whether this is actually the issue or still env variables.

incorporating a wait-for-it type script maybe something we pursue still though, so will open an issue.

bhgrant8 commented 6 years ago

I think we identified that cause of this, while we have the question of the ideal startup, would we consider this issue still open?

znmeb commented 6 years ago

If it's working, close it!