Can't run Phoenix using docker-compose

Never use the root user in any docker image, just like you would not use it in a real server.

The database is open to the internet. You don’t need to expose the ports for the elixir service to be able to reach it.

This is not necessary, instead just change the name of the docker-compose service from PostgreSQL to postgres.

If is for running in localhost then you need to do it like, otherwise it may be reachable from the internet, unless you have other security measures in place.

The use of 4040:4000 is equivalent to, and means it will be listening in all configured networks on your computer.

It’s unsafe to use the nobody user as I report on this issue and now being merged to the official docs.