5

I have a docker compose file where i am launching PostgreSQL with shared volume. But i am continuously getting the bellow ERROR.

2018-10-11 14:57:01.757 GMT [81] LOG:  skipping missing configuration 
file "/postgresql/data/postgresql.auto.conf"
| 2018-10-11 14:57:01.768 GMT [81] FATAL:  data directory "/postgresql/data" has wrong ownership
| 2018-10-11 14:57:01.768 GMT [81] HINT:  The server must be started by the user that owns the data directory.

My docker compose file as below

addb:
image : postgres
networks:
  - private
ports:
  - "5432:5432"
volumes:
  - /mnt/shared/app_data/db/postgres/data_db:/postgresql/data
depends_on:
  - sol-server

I am using RHEL 7.5 and Docker version 18.06.1-ce, build e68fc7. Any Idea how i can resolve the above issue.

rakeeee
  • 973
  • 4
  • 19
  • 44

1 Answers1

0

You should mount your volume with the database in /var/lib/postgresql/data instead of /postgresql/data or give a enviroment PGDATA=/postgresql/data

DoctorWho
  • 1,044
  • 11
  • 34
Gerbs
  • 41
  • 5