2020-08-17 09:45:42 +02:00
|
|
|
version: "3.8"
|
2019-09-28 12:58:18 +02:00
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
command: --save 900 1
|
|
|
|
ports:
|
|
|
|
- "6379:6379"
|
|
|
|
volumes:
|
|
|
|
- /data/redis:/data
|
|
|
|
deploy:
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
|
|
|
|
postgres:
|
|
|
|
image: postgres:alpine
|
|
|
|
ports:
|
|
|
|
- "5432:5432"
|
|
|
|
volumes:
|
|
|
|
- /data/postgres:/var/lib/postgresql/data
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=airflow
|
|
|
|
- POSTGRES_PASSWORD=airflow
|
|
|
|
- POSTGRES_DB=airflow
|
|
|
|
deploy:
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
|
|
|
|
webserver:
|
|
|
|
image: vimagick/airflow
|
|
|
|
command: webserver
|
|
|
|
ports:
|
|
|
|
- "8080:8080"
|
|
|
|
volumes:
|
|
|
|
- airflow_data:/opt/airflow
|
|
|
|
deploy:
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
|
|
|
- redis
|
|
|
|
|
|
|
|
scheduler:
|
|
|
|
image: vimagick/airflow
|
|
|
|
command: scheduler
|
|
|
|
volumes:
|
|
|
|
- airflow_data:/opt/airflow
|
|
|
|
deploy:
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
depends_on:
|
|
|
|
- webserver
|
|
|
|
|
|
|
|
flower:
|
|
|
|
image: vimagick/airflow
|
|
|
|
command: flower
|
|
|
|
ports:
|
|
|
|
- "5555:5555"
|
|
|
|
volumes:
|
|
|
|
- airflow_data:/opt/airflow
|
|
|
|
deploy:
|
|
|
|
replicas: 1
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
depends_on:
|
|
|
|
- webserver
|
|
|
|
|
|
|
|
worker:
|
|
|
|
image: vimagick/airflow
|
|
|
|
command: worker
|
|
|
|
volumes:
|
|
|
|
- airflow_data:/opt/airflow
|
|
|
|
deploy:
|
2020-08-17 09:45:42 +02:00
|
|
|
replicas: 3
|
2019-09-28 12:58:18 +02:00
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == worker
|
2020-08-17 09:45:42 +02:00
|
|
|
max_replicas_per_node: 1
|
2019-09-28 12:58:18 +02:00
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
depends_on:
|
|
|
|
- webserver
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
|
|
airflow_data:
|
|
|
|
driver: local
|
|
|
|
driver_opts:
|
|
|
|
type: nfs
|
|
|
|
o: "addr=10.0.0.1,nolock,soft,rw"
|
|
|
|
device: ":/export/airflow"
|