-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
137 lines (128 loc) · 3.59 KB
/
docker-compose.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
x-airflow-common: &airflow-common
build:
context: .
dockerfile: Dockerfile
environment: &airflow-common-env
AIRFLOW__CORE__EXECUTOR: LocalExecutor #локальный запуск
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CORE__FERNET_KEY: ''
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__API__AUTH_BACKENDS: 'airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session'
AIRFLOW__SCHEDULER__ENABLE_HEALTH_CHECK: 'true'
AIRFLOW__WEBSERVER__SECRET_KEY: 'your_airflow_webserver_sec_key'
_PIP_ADDITIONAL_REQUIREMENTS: ''
AIRFLOW_INPUT_DIR: '/opt/airflow/dag-inputs'
volumes:
- ./dags:/opt/airflow/dags
- ./dags/sql:/opt/airflow/dags/sql
- ./requirements.txt:/opt/airflow/requirements.txt
- ./data:/opt/airflow/sample_files
user: "${AIRFLOW_UID:-50000}:0"
depends_on: &airflow-common-depends-on
postgres:
condition: service_healthy
networks:
- dag_sample
services:
postgres:
image: postgres:16.0
volumes:
- ./db/init-db.sql:/docker-entrypoint-initdb.d/db.sql
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
logging:
options:
max-size: 10m
max-file: "3"
healthcheck:
test:
- CMD
- pg_isready
- -U
- airflow
interval: 10s
retries: 5
start_period: 5s
restart: always
networks:
- dag_sample
airflow-webserver:
<<: *airflow-common
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
command: webserver
networks:
- dag_sample
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
airflow-scheduler:
<<: *airflow-common
networks:
- dag_sample
command: scheduler
depends_on:
postgres:
condition: service_healthy
airflow-webserver:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
airflow-triggerer:
<<: *airflow-common
depends_on:
postgres:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
networks:
- dag_sample
command: bash -c "airflow triggerer"
healthcheck:
test:
- CMD-SHELL
- airflow jobs check --job-type TriggererJob --hostname "${HOSTNAME}"
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
airflow-cli:
<<: *airflow-common
depends_on:
postgres:
condition: service_healthy
networks:
- dag_sample
profiles:
- debug
command:
- bash
- -c
- airflow
airflow-init:
<<: *airflow-common
depends_on:
postgres:
condition: service_healthy
command: >
bash -c " airflow db init && airflow users create \ --username admin \ --firstname admin \ --lastname admin \ --role Admin \ --email [email protected] \ --password admin
"
networks:
- dag_sample
networks:
dag_sample: