Unlock this challenge:
Postgres databases typically start on port 5432. In this tutorial, we ran this command:
psql --user=symfony --port=50700 --host=127.0.0.1 --password app
Why is our database running on port 50700?
The database is running on port 5432 inside the Docker container, but then that port is exposed to 50700 on my "host" machine. 50700 is a random port chosen by Docker.
The database is running on port 5432 inside the Docker container, but then that port is exposed to 50700 on my "host" machine. By convention, 50700 is the port chosen by docker-compose for Postgres.
Our docker-compose.yml file contains configuration that tells Postgres to start on port 50700 to avoid conflicts.
docker-compose.yml