That’s because the postgres image creates a default database and database user based on those environment variables on the first time it runs (assuming a volume is persisted).
Perhaps you changed those values after you’ve upped your project?
If that’s the case you’ll want to delete your postgres volume which you could do by running docker-compose down -v, but please don’t run that in production. That’s just meant as a quick and easy way to destroy all volumes which is handy for development.
If you’re in production you would want to either change your user and password values to match what they were when you first ran your compose project, or use psql to manually change the user / password to whatever new ones you set (similar to what you would do without Docker).


















