forked from xnuinside/airflow_in_docker_compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-with-celery-executor.yml
113 lines (104 loc) · 2.23 KB
/
docker-compose-with-celery-executor.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
---
version: '3.2'
x-airflow-common:
&airflow-common
image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:1.10.12-python3.7}
env_file:
- .env
volumes:
- ./airflow_files/dags:/opt/airflow/dags
- ./logs:/opt/airflow/logs
- ./files:/opt/airflow/files
- /var/run/docker.sock:/var/run/docker.sock
networks:
- airflow
networks:
airflow:
services:
postgres:
image: postgres:13.1
environment:
- POSTGRES_USER=airflow
- POSTGRES_DB=airflow
- POSTGRES_PASSWORD=airflow
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- 5432:5432
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./database/data:/var/lib/postgresql/data/pgdata
- ./database/logs:/var/lib/postgresql/data/log
command: >
postgres
-c listen_addresses=*
-c logging_collector=on
-c log_destination=stderr
-c max_connections=200
networks:
- airflow
redis:
image: redis:5.0.5
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
ports:
- 6379:6379
networks:
- airflow
webserver:
<<: *airflow-common
ports:
- 8080:8080
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
depends_on:
- postgres
- redis
command: webserver
healthcheck:
test: ["CMD-SHELL", "[ -f /opt/airflow/airflow-webserver.pid ]"]
interval: 30s
timeout: 30s
retries: 3
flower:
<<: *airflow-common
ports:
- 5555:5555
depends_on:
- redis
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
volumes:
- ./logs:/opt/airflow/logs
command: flower
scheduler:
<<: *airflow-common
command: scheduler
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
worker:
<<: *airflow-common
command: worker
depends_on:
- scheduler
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
initdb:
<<: *airflow-common
entrypoint: /bin/bash
deploy:
restart_policy:
condition: on-failure
max_attempts: 5
command: -c "airflow initdb"
depends_on:
- redis
- postgres