This commit is contained in:
2025-03-01 23:36:07 +01:00
parent 336a949485
commit 83033f0637

View File

@ -63,6 +63,7 @@ services:
env_file: env_file:
- stack.env - stack.env
environment: environment:
POSTGRES_INITDB_ARGS: '--data-checksums' POSTGRES_INITDB_ARGS: '--data-checksums'
volumes: volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
@ -70,8 +71,8 @@ services:
- /share/docker_data/immich/db:/var/lib/postgresql/data - /share/docker_data/immich/db:/var/lib/postgresql/data
healthcheck: healthcheck:
test: >- test: >-
pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; pg_isready --dbname="$${DB_PASSWORD}" --username="$${DB_USERNAME}" || exit 1;
Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align Chksum="$$(psql --dbname="$${DB_DATABASE_NAME}" --username="$${DB_USERNAME}" --tuples-only --no-align
--command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')";
echo "checksum failure count is $$Chksum"; echo "checksum failure count is $$Chksum";
[ "$$Chksum" = '0' ] || exit 1 [ "$$Chksum" = '0' ] || exit 1