My docker-compose.yml is
database:
container_name: k4fntr_database
build: ./docker/postgres
restart: always
environment:
ENV: ${APP_ENV}
TESTING_DB: ${DB_DATABASE_TESTING}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "15432:5432"
volumes:
- ./docker/postgres/pg-data:/var/lib/postgresql/data
networks:
- backend-network
and my Dockerfile is
FROM postgres:10.5-alpine
COPY /docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
RUN chmod 0755 -R /docker-entrypoint-initdb.d/
I have a problem when I run
docker-compose up -d --build
a folder which is called pg-data is created with wrong permissions from user "70" and group "root"
This permissions don't let me to do any things such as look inside the folder. In addition, when I try to rebuild the container with
docker-compose up -d --build
I get an error
PermissionError: [Errno 13] Permission denied: '/home/ubuntu/PhpstormProjects/fntr/docker/postgres/pg-data' [5262] Failed to execute script docker-compose
I run docker-compose as user ubuntu:ubuntu.
The situation was changed a little bit when I created folder BEFORE run
docker-compose up -d --build
In this case the folder has group "ubuntu" but the owner is still "70"
but there is no some effects and all problems are exists


/etc/passwdbut it is not resolvable on the host machine.