I came accross a URL syntax in a config file, but I don't get the meaning of some of it:
DATABASE_URL=postgresql://myuser:myuser@db:5432/db_prod
More specifically:
the
//myuser:myuser
part. This is the url that Flask (a web service in my docker-compose file) uses to connect to the db (postgres). The username for the postgres db is indeed myuser as defined in POSTGRES_USER environment variable, however I don't get why this is repeated here.The meaning of
=postgresql:
. That's not the name of my service, nor the name of the image (which ispostgres:13.1
).
The rest is clear to me:
db
: name of the service in the docker networkdb_prod
: name of the database to connect to5432
: the port on which the db services listen to on the local docker network
thanks!