Skip to content

Commit 90a2401

Browse files
iobrunoclaude
andcommitted
fix/airflow2-pgsql-mount: Fix Postgres volume mount and healthcheck for postgres:18-alpine+
Update mount point from /var/lib/postgresql/data to /var/lib/postgresql and use $$POSTGRES_USER in pg_isready healthchecks to dynamically match each service's configured user. This fixes compatibility with postgres:18-alpine and later, following the PGDATA relocation introduced in docker-library/postgres#1394. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent adfbd87 commit 90a2401

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

module2-workflow-orchestration/airflow-2.x/compose.celery.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ services:
5252
ports:
5353
- '5432:5432'
5454
volumes:
55-
- vol-ingest-db:/var/lib/postgresql/data
55+
- vol-ingest-db:/var/lib/postgresql
5656
healthcheck:
57-
test: ["CMD-SHELL", "pg_isready -U postgres"]
57+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
5858
interval: 5s
5959
timeout: 5s
6060
retries: 5
@@ -70,9 +70,9 @@ services:
7070
ports:
7171
- '5432'
7272
volumes:
73-
- vol-airflow-metastore-celeryexec:/var/lib/postgresql/data
73+
- vol-airflow-metastore-celeryexec:/var/lib/postgresql
7474
healthcheck:
75-
test: ["CMD-SHELL", "pg_isready -U postgres"]
75+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
7676
interval: 5s
7777
timeout: 3s
7878
retries: 5

module2-workflow-orchestration/airflow-2.x/compose.local.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ services:
4646
ports:
4747
- '5432:5432'
4848
volumes:
49-
- vol-ingest-db:/var/lib/postgresql/data
49+
- vol-ingest-db:/var/lib/postgresql
5050
healthcheck:
51-
test: ["CMD-SHELL", "pg_isready -U postgres"]
51+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
5252
interval: 5s
5353
timeout: 5s
5454
retries: 5
@@ -64,9 +64,9 @@ services:
6464
ports:
6565
- '5432'
6666
volumes:
67-
- vol-airflow-metastore-localexec:/var/lib/postgresql/data
67+
- vol-airflow-metastore-localexec:/var/lib/postgresql
6868
healthcheck:
69-
test: ["CMD-SHELL", "pg_isready -U postgres"]
69+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
7070
interval: 5s
7171
timeout: 3s
7272
retries: 5

0 commit comments

Comments
 (0)