L
L
LakeForest2022-03-31 19:59:20
linux
LakeForest, 2022-03-31 19:59:20

How to return permissions to all project folders so that all folders stop being tinted as if they have been changed?

I have a project repository with applications: dockerfile, docker-compose.yaml, database volume is thrown into this "./postgres" folder.
At first, the repository belonged to another person, and I couldn't update the service because I didn't have permissions: docker-compose up -d --build app -> wrote that I didn't have permission to change the folder, change the database. (Restarting affects the database in some way.)
I first corrected the owner of the repo:
sudo chown -R user:user .
Again I tried to update docker-compose up -d --build app - the containers themselves in the repository no longer have access to the database.
I reverted the ./postgres folder to be owned by root:root, as this folder was created automatically by docker.
And as a result, the external service stopped having access to the ./postgres folder (where the database is).
I foolishly did sudo chmod -R 777 .
The entire repo is dyed orange. This was clearly overkill on my part. It was worth leaving the MB only in the database.
External service access is back, but docker-compose up -d --build app - still can't do it right. Again writes no rights.

1. How can I return the normal rights to the repository so that it stops painting in orange and does not ruin the database (in terms of leaving it available)?
2. How to update the application that is connected to the database so that it does not write that there is no access?

UPD:
docker-compose down
docker-compose up -d
Now the postgres container is not raised:
but could not open file "/var/lib/postgresql/data/global/pg_control": Permission denied

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question