-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·75 lines (71 loc) · 1.83 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
version: "3.8"
x-airflow-common:
environment:
&airflow-common-env
AIRFLOW__CORE__FERNET_KEY: ''
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
AIRFLOW__CORE__LOAD_EXAMPLES: 'true'
STAGE: dev
services:
postgres:
image: postgres:13.3-alpine
restart: always
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
volumes:
- ./postgres_data:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 5s
retries: 5
logging:
options:
max-size: "10m"
max-file: "3"
webserver:
image: airflow-local:latest
build: .
depends_on:
postgres:
condition: service_healthy
command: bash -c "airflow db init && airflow webserver"
volumes:
- ./dags:/usr/local/airflow/dags
- ./plugins:/usr/local/airflow/plugins
ports:
- 8080:8080
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 15s
timeout: 15s
retries: 6
environment:
<<: *airflow-common-env
scheduler:
image: airflow-local:latest
depends_on:
postgres:
condition: service_healthy
webserver:
condition: service_healthy
command: |
airflow scheduler
volumes:
- ./dags:/usr/local/airflow/dags
- ./plugins:/usr/local/airflow/plugins
environment:
<<: *airflow-common-env
init:
image: airflow-local:latest
command: airflow users create --username airflow --password airflow --firstname admin --lastname admin --role Admin --email [email protected]
depends_on:
postgres:
condition: service_healthy
webserver:
condition: service_healthy
environment:
<<: *airflow-common-env