markdegrootnl / unifi-protect-x86

Run UniFi Protect in Docker on x86 hardware
49 stars 7 forks source link

Change permissions before initializing database #5

Closed brad-anton closed 1 year ago

brad-anton commented 3 years ago

When attempting to run this container for the first time with a custom database volume, the container exits with the following logs because docker-entrypoint.sh attempts to initialize the database without first changing the permissions of the data directory.

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: could not change permissions of directory "/var/lib/postgresql/10/main": Operation not permitted
fixing permissions on existing directory /var/lib/postgresql/10/main ...