Skip to content

Commit f32b9c4

Browse files
Update docker-compose.yaml
1 parent 05c5969 commit f32b9c4

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docker-compose.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ x-airflow-common:
3030
environment:
3131
&airflow-common-env
3232
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
33-
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
33+
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
3434
# For backward compatibility, with Airflow <2.3
35-
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
35+
# postgresql+psycopg2://airflow:airflow@postgres/airflow
36+
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
3637
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
3738
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
3839
AIRFLOW__CORE__FERNET_KEY: ''
@@ -65,9 +66,10 @@ services:
6566
volumes:
6667
- postgres-db-volume:/var/lib/postgresql/data
6768
healthcheck:
68-
test: ["CMD", "pg_isready", "-U", "airflow"]
69-
interval: 5s
70-
retries: 5
69+
test: ["CMD-SHELL", "pg_isready -U airflow -h localhost"]
70+
interval: 10s
71+
timeout: 5s
72+
retries: 15
7173
restart: always
7274

7375
redis:
@@ -76,9 +78,10 @@ services:
7678
- 6379
7779
healthcheck:
7880
test: ["CMD", "redis-cli", "ping"]
79-
interval: 5s
81+
interval: 10s
8082
timeout: 30s
8183
retries: 50
84+
start_period: 30s
8285
restart: always
8386

8487

@@ -150,6 +153,7 @@ services:
150153
interval: 10s
151154
timeout: 10s
152155
retries: 5
156+
start_period: 30s
153157
environment:
154158
<<: *airflow-common-env
155159
# Required to handle warm shutdown of the celery workers properly
@@ -159,16 +163,17 @@ services:
159163
depends_on:
160164
<<: *airflow-common-depends-on
161165
airflow-init:
162-
condition: service_completed_successfully
166+
condition: service_completed_successfully
163167

164168
airflow-triggerer:
165169
<<: *airflow-common
166170
command: triggerer
167171
healthcheck:
168172
test: ["CMD-SHELL", 'airflow jobs check --job-type TriggererJob --hostname "$${HOSTNAME}"']
169-
interval: 10s
173+
interval: 30s
170174
timeout: 10s
171175
retries: 5
176+
start_period: 30s
172177
restart: always
173178
depends_on:
174179
<<: *airflow-common-depends-on
@@ -281,6 +286,7 @@ services:
281286
interval: 10s
282287
timeout: 10s
283288
retries: 5
289+
start_period: 30s
284290
restart: always
285291
depends_on:
286292
<<: *airflow-common-depends-on

0 commit comments

Comments
 (0)