I don't know where I have the information stored in the host so that every time I do the up I find that the database exists. I thought that deleting the containers and the shared volume would be enough. But this is not the case, can anyone explain me what exactly is happening?
It is worth noting that the permissions that appear in the PATH_TO_DATABASE folder are systemd-coredump:root. In case this is useful
Hi community,
I have implemented this docker-compose file:
create_database.sql
contains this line:CREATE DATABASE mydatabase;
The problem is as follows:
I would like the database to be created every time I launch
docker compose up.
What happens is that I delete the containers, I delete the shared folder (
PATH_TO_DATABASE
) and when I launch it again, I get the following error:psql:/docker-entrypoint-initdb.d/create_tables.sql:2: ERROR: database "mydatabase" already exists
I don't know where I have the information stored in the host so that every time I do the up I find that the database exists. I thought that deleting the containers and the shared volume would be enough. But this is not the case, can anyone explain me what exactly is happening?
It is worth noting that the permissions that appear in the
PATH_TO_DATABASE
folder are systemd-coredump:root. In case this is usefulBest regards and thank you very much