TwentyT
Twenty16mo ago
14 replies
TwoPigs

Permission denied - PostgreSQL

For me, this compose file is resulting in the following error

https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/docker-compose.yml

postgresql 10:48:15.42 INFO  ==> ** Starting PostgreSQL setup **

postgresql 10:48:15.44 INFO  ==> Validating settings in POSTGRESQL_* env vars..

postgresql 10:48:15.45 INFO  ==> Loading custom pre-init scripts...

postgresql 10:48:15.46 INFO  ==> Initializing PostgreSQL database...

mkdir: cannot create directory ‘/bitnami/postgresql/data’: Permission denied


I tried updating the change-vol-ownership trickery but with no luck

  change-vol-ownership:
    image: ubuntu
    user: root
    volumes:
      - /mnt/user/appdata/twenty:/tmp/server-local-data
      - docker-data:/tmp/docker-data
      - /mnt/user/appdata/twenty/db-data:/tmp/db-data  # Add this line
    command: >
      bash -c "
      chown -R 1000:1000 /tmp/server-local-data
      && chown -R 1000:1000 /tmp/docker-data
      && chown -R 1001:1001 /tmp/db-data"  # Add this line


Any advise?
Was this page helpful?