Fix YAML syntax error in Immich docker-compose templates
The healthcheck test value contained "googlechecksum: $$Chksum" which YAML interprets as a mapping separator (colon-space in an unquoted scalar). This caused "mapping values are not allowed in this context" on the command line below it. Fixed by using >- block scalar for the healthcheck test and multi-line array format for the postgres command, matching the official Immich docker-compose format. https://claude.ai/code/session_01NAtxAkC5t6YVb3gcP1VcX8
This commit is contained in:
+36
-4
@@ -3039,11 +3039,27 @@ services:
|
||||
volumes:
|
||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; echo "googlechecksum: $$Chksum"; exit 0
|
||||
test: >-
|
||||
pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1;
|
||||
Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align
|
||||
--command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0)
|
||||
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname = ''public'' AND c.relkind = ''r''')";
|
||||
echo "googlechecksum: $$Chksum";
|
||||
exit 0
|
||||
interval: 5m
|
||||
start_interval: 30s
|
||||
start_period: 5m
|
||||
command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
|
||||
command:
|
||||
[
|
||||
"postgres",
|
||||
"-c", "shared_preload_libraries=vectors.so",
|
||||
"-c", 'search_path="$$user", public, vectors',
|
||||
"-c", "logging_collector=on",
|
||||
"-c", "max_wal_size=2GB",
|
||||
"-c", "shared_buffers=512MB",
|
||||
"-c", "wal_compression=on",
|
||||
]
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
@@ -3101,11 +3117,27 @@ services:
|
||||
volumes:
|
||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; echo "googlechecksum: $$Chksum"; exit 0
|
||||
test: >-
|
||||
pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1;
|
||||
Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align
|
||||
--command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0)
|
||||
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname = ''public'' AND c.relkind = ''r''')";
|
||||
echo "googlechecksum: $$Chksum";
|
||||
exit 0
|
||||
interval: 5m
|
||||
start_interval: 30s
|
||||
start_period: 5m
|
||||
command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
|
||||
command:
|
||||
[
|
||||
"postgres",
|
||||
"-c", "shared_preload_libraries=vectors.so",
|
||||
"-c", 'search_path="$$user", public, vectors',
|
||||
"-c", "logging_collector=on",
|
||||
"-c", "max_wal_size=2GB",
|
||||
"-c", "shared_buffers=512MB",
|
||||
"-c", "wal_compression=on",
|
||||
]
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user