I am trying to run a a project with docker-compose and I am getting mkdir: cannot create directory ‘/home/postgres/pgdata/data’: permission denied. This problem only occurs on windows, on macOS the setup works fine. I think it has to do with user permissions on windows for docker.
The compose config:
volumes:
volume_name:
name: data
postgres:
container_name: postgres
image: timescale/timescaledb-ha:pg14.7-ts2.10.2-latest
ports:
- "5433:5432"
volumes:
- ./data:/home/postgres/pgdata
env_file:
- ./.envs/.local/.postgres
Any idea what I could do to fix this? Thanks in advance, help is much appreciated
datadirectory in your./datadirectory, so Postgres doesn't need to do it.docker upprocess this directory gets created automatically with all files in it. Do you mean I should map thedatadirectory to/home/postgres/pgdata/datainstead of/home/postgres/pgdata?- ./data:/home/postgres/pgdatato- data:/home/postgres/pgdata. Remove./."data:/home/postgres/pgdata:rw" is used in service "postgres" but no declaration was found in the volumes section../datatodatamakes it a volume instead of a bind mount