-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.airflow_1.yml
73 lines (67 loc) · 1.97 KB
/
docker-compose.airflow_1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
version: '3'
x-airflow-common:
&airflow-common
image: airflow_local_dev_1
environment:
&airflow-common-env
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__CORE__SQL_ALCHEMY_POOL_RECYCLE: 3600
AIRFLOW_HOME_BI: /opt/airflow
PYTHONPATH: /opt/airflow/python_scripts
# GOOGLE_CLOUD_PROJECT: indriver-bi
volumes:
- ${AIRFLOW_1_CONTENT_FOLDER}/dags:/opt/airflow/dags
- ${AIRFLOW_1_CONTENT_FOLDER}/python_scripts:/opt/airflow/python_scripts
- ./logs:/opt/airflow/logs
- /Users/${USER}/.config/gcloud/application_default_credentials.json:/home/airflow/.config/gcloud/application_default_credentials.json
user: "${AIRFLOW_UID:-50000}:${AIRFLOW_GID:-50000}"
depends_on:
postgres:
condition: service_healthy
services:
airflow-init:
<<: *airflow-common
entrypoint: /bin/bash -c "/bin/bash -c \"$${@}\""
command: |
/bin/bash -c "
airflow db init
airflow db upgrade
airflow users create -r Admin -u admin -e airflow@airflow.com -f admin -l user -p admin
"
environment:
<<: *airflow-common-env
postgres:
image: postgres:13
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
# volumes:
# - ./metadata_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 5s
retries: 5
restart: always
airflow-scheduler:
<<: *airflow-common
command: scheduler
environment:
<<: *airflow-common-env
restart: always
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- 8081:8080
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 10s
timeout: 10s
retries: 5
restart: always
environment:
<<: *airflow-common-env