Permission Error Prevents PostgreSQL Container Initialization in Docker Compose

I have configured PostgreSQL to be used as the database for my application, replacing HSQLDB. However, I am encountering a permission issue when trying to initialize the PostgreSQL container within my Docker Compose setup. This issue prevents the proper initialization and functioning of the PostgreSQL container. here is the issue :

dockerCompose1

and here is my docker compose file :

file2

Greetings, as i can understand your docker container has no rights to read/write access for volume path.
For fix this run “sudo chmod 700 -R /var/lib/postgresql/data” or give access for DOCKER user or user group, by the way this error occur cause of lack privileges for docker.

1 Like