-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdocker-compose.yml
73 lines (70 loc) · 2.2 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
version: '3'
services:
webserver:
image: apache/airflow:2.6.0-python3.9
command: webserver
entrypoint: [ "/opt/airflow/script/entrypoint.sh" ]
# restart: always
depends_on:
- postgres
environment:
- AIRFLOW__CORE__LOAD_EXAMPLES=False
- AIRFLOW__CORE__EXECUTOR=SequentialExecutor
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
- AIRFLOW__WEBSERVER_BASE_URL=http://localhost:8080
- AIRFLOW__WEBSERVER__SECRET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
logging:
options:
max-size: 10m
max-file: "3"
volumes:
- ./dags:/opt/airflow/dags
- ./script/entrypoint.sh:/opt/airflow/script/entrypoint.sh
- ./requirements.txt:/opt/airflow/requirements.txt
- ./data:/opt/airflow/data
- ./pipelines:/opt/airflow/pipelines
# - ./airflow.cfg:/opt/airflow/airflow.cfg
# - ./airflow.db:/opt/airflow/airflow.db
ports:
- "8080:8080"
healthcheck:
test: [ "CMD", "curl", "--fail", "http://localhost:8080/health" ]
interval: 30s
timeout: 10s
retries: 3
networks:
- confluent
postgres:
image: postgres:14.0
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
logging:
options:
max-size: 10m
max-file: "3"
networks:
- confluent
scheduler:
image: apache/airflow:2.6.0-python3.9
# restart: always
depends_on:
webserver:
condition: service_healthy
volumes:
- ./dags:/opt/airflow/dags
- ./requirements.txt:/opt/airflow/requirements.txt
- ./data:/opt/airflow/data
- ./pipelines:/opt/airflow/pipelines
environment:
- LOAD_EX=n
- EXECUTOR=Sequential
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
- AIRFLOW__WEBSERVER_BASE_URL=http://localhost:8080
- AIRFLOW__WEBSERVER__SECRET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
command: bash -c "pip install --no-cache-dir -r ./requirements.txt && airflow db upgrade && airflow scheduler"
networks:
- confluent
networks:
confluent: