-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (65 loc) · 1.63 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
version: '3'
x-airflow-common:
&airflow-common
build:
context: .
dockerfile: Dockerfile
env_file:
- airflow.env
volumes:
- ./dags:/opt/airflow/dags
- ./data:/opt/airflow/data
- ./logs:/opt/airflow/logs
- ./pipelines:/opt/airflow/pipelines
- ./utils:/opt/airflow/utils
- postgres_data:/var/lib/postgresql/data
depends_on:
- postgres
- redis
services:
postgres:
image: postgres:12
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: airflow_kaggle
POSTGRES_PORT: 5432
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.0
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
airflow-init:
<<: *airflow-common
command: >
bash -c "pip install -r /opt/airflow/requirements.txt &&
airflow db init &&
airflow db upgrade &&
airflow users create --username admin --firstname admin --lastname admin --role Admin --email airflow@airflow.com --password admin"
restart: "no"
airflow-webserver:
<<: *airflow-common
command: webserver
ports:
- "8080:8080"
airflow-scheduler:
<<: *airflow-common
command: scheduler
airflow-worker:
<<: *airflow-common
command: celery worker
volumes:
postgres_data