-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
98 lines (90 loc) · 2.17 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
version: '3.9'
x-common:
&common
build:
context: .
dockerfile: ./projects/airflow/Dockerfile # Dockerfile we created for Airflow in order to install our requirements
env_file:
- .env # all the important env variables are here
volumes:
- ./projects/airflow/dags:/opt/airflow/dags
- ./projects/airflow/logs:/opt/airflow/logs
- ./projects/airflow/plugins:/opt/airflow/plugins
- ./projects/dbt:/opt/airflow/dbt
- /var/run/docker.sock:/var/run/docker.sock
# All the necessary volumes are setup for airflow, based on our files/projects
x-depends-on:
&depends-on
depends_on:
postgres:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
services:
postgres:
image: postgres
hostname: postgres
container_name: postgresdb
env_file:
- .env
ports:
- '5431:5432'
networks:
- airflowdbt
volumes:
- ./projects/postgres/docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U airflowdbt"]
interval: 5s
timeout: 5s
retries: 5
metabase:
container_name: vismetabase
depends_on:
- postgres
hostname: metabase
build: metabase/ # Dockerfile we created for metabase
volumes:
- ./conf/metabase:/conf
ports:
- 3030:3030
networks:
- airflowdbt
scheduler:
<<: *common
<<: *depends-on
container_name: dbtairflow-scheduler
command: scheduler
restart: on-failure
ports:
- "8793:8793"
networks:
- airflowdbt
webserver:
<<: *common
<<: *depends-on
container_name: dbtairflow-webserver
restart: always
command: webserver
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 30s
timeout: 30s
retries: 5
networks:
- airflowdbt
airflow-init:
<<: *common
container_name: dbtairflow-init
entrypoint: /bin/bash
command:
- -c
- |
exec /entrypoint airflow version
networks:
- airflowdbt
networks:
airflowdbt:
driver: bridge