-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
164 lines (153 loc) · 3.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
164 lines (153 loc) · 3.72 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: ingestion-bridge
services:
# Conditionally deploy Mage service
mage:
build: ./mage
ports:
- "6789:6789"
volumes:
- ./mage:/home/src
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_MAGE:-false}
# Conditionally deploy Flink service
flink-jobmanager:
build: ./flink
command: jobmanager
ports:
- "8081:8081"
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_FLINK:-false}
flink-taskmanager:
build: ./flink
command: taskmanager
depends_on:
- flink-jobmanager
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_FLINK:-false}
# Kafka and Zookeeper services
kafka:
image: confluentinc/cp-kafka:7.5.0
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_KAFKA:-false}
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_ZOOKEEPER:-false}
# Jenkins
jenkins:
build: ./jenkins
ports:
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- backend
restart: unless-stopped
deploy:
mode: ${ENABLE_JENKINS:-false}
# Airflow Webserver
airflow:
build: ./airflow
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_started
flink-jobmanager:
condition: service_started
environment:
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
- AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres/airflow
ports:
- "8089:8080"
volumes:
- ./airflow/dags:/opt/airflow/dags
- ./airflow/logs:/opt/airflow/logs
- ./airflow/plugins:/opt/airflow/plugins
- ./pipelines:/opt/airflow/pipelines # Mount the pipeline config and producer code
- ./airflow/data:/opt/airflow/data # Optional: to persist generated data
command: webserver
networks:
- backend
restart: always
airflow_scheduler:
build: ./airflow
depends_on:
postgres:
condition: service_healthy
environment:
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
- AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres/airflow
volumes:
- ./airflow/dags:/opt/airflow/dags
- ./airflow/logs:/opt/airflow/logs
- ./airflow/plugins:/opt/airflow/plugins
command: scheduler
networks:
- backend
restart: always
# Postgres service for Airflow
postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 10s
retries: 5
restart: unless-stopped
deploy:
mode: ${ENABLE_POSTGRES:-true} # Ensure you can control this service too
# Static Website and API
dashboard:
build: ./launchpad
ports:
- "5000:5000"
networks:
- backend
restart: unless-stopped
volumes:
- ./launchpad:/app
networks:
backend:
driver: bridge
# Named volumes for persistent data
volumes:
postgres_data: