I have a freshly generated Phoenix app and I'm trying to Dockerize it.
I'm running into the following issue:
If I boot Phoenix locally (mix phx.server
) it works fine (connects to localhost PG)
If I run it in PROD (MIX_ENV=prod mix phx.server
) it connects to RDS
If I run in Docker / dev mode (docker-compose up
) I get this connection error
If I run in Docker / prod mode I get the same error
I figure Docker not connecting locally is due to some networking issue (localhost vs docker host), but it still looks for localhost when running in prod.
Tried:
`docker-compose -f docker-compose.yml -f docker-compose.prod.yml up`
`MIX_ENV=prod docker-compose -f docker-compose.yml -f docker-compose.prod.yml up`
I’ve tried Phoenix 1.3 and the latest RCs with no luck.
Elixir does ask for a DATABASE_URL
on top of the normal prod.secret.exs DB config
I even tried putting a PG container into the compose setup and linked it. Elixir still asks for Localhost.
No DATABASE_URL in my env.
I’ve tried umbrella apps all the way to vanilla Phoenix. No love at all.
I have exported PORT (as Elixir wants that)