Skip to content
Advertisement

“Database ‘docker-db’ does not exist”

so I have this problem building django/postgre app with docker. it keeps saying “database does not exist” and quite few time googling doesnt bring any results. I already scrapped the volumes and rebuilt my app few times, followed different guides on how people do the postgres, still no luck making it work for me. Dockerfile

JavaScript

compose.yml

JavaScript

.env

JavaScript

UPDATE: Error messages starts with

JavaScript

and then my django starts spamming the same

JavaScript

but the weird thing is, then it proceeds giving same errors from db, but

JavaScript

this time it says “database ‘docker'” but I dont have DB name “docker” used in my code

Full error:

JavaScript

Advertisement

Answer

So, the answer was pretty simple and pretty “I don’t know what was that”.

First thing, I forgot to add DATABASE=postgres in my .env file, which was crucial for Django to notice the needed db

The problem with db searching for not-asked-for db? No idea, I just renamed needed db to “docker”, which my db service looked for, and it worked.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement