-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
226 lines (221 loc) · 5.44 KB
/
docker-compose.yml
File metadata and controls
226 lines (221 loc) · 5.44 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
networks:
pulsar:
driver: bridge
sidecar:
driver: bridge
services:
# Start zookeeper
zookeeper:
image: apachepulsar/pulsar:latest
profiles: ["pulsar"]
container_name: zookeeper
restart: on-failure
networks:
- pulsar
volumes:
- ./data/zookeeper:/pulsar/data/zookeeper
environment:
- metadataStoreUrl=zk:zookeeper:2181
command: >
bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \
bin/generate-zookeeper-config.sh conf/zookeeper.conf && \
exec bin/pulsar zookeeper"
healthcheck:
test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"]
interval: 10s
timeout: 5s
retries: 30
# Init cluster metadata
pulsar-init:
container_name: pulsar-init
hostname: pulsar-init
image: apachepulsar/pulsar:latest
profiles: ["pulsar"]
networks:
- pulsar
command: bin/pulsar initialize-cluster-metadata --cluster cluster-a --zookeeper zookeeper:2181 --configuration-store zookeeper:2181 --web-service-url http://broker:8080 --broker-service-url pulsar://broker:6650
depends_on:
zookeeper:
condition: service_healthy
# Start bookie
bookie:
image: apachepulsar/pulsar:latest
profiles: ["pulsar"]
container_name: bookie
restart: on-failure
networks:
- pulsar
environment:
- clusterName=cluster-a
- zkServers=zookeeper:2181
- metadataServiceUri=metadata-store:zk:zookeeper:2181
depends_on:
zookeeper:
condition: service_healthy
pulsar-init:
condition: service_completed_successfully
# Map the local directory to the container to avoid bookie startup failure due to insufficient container disks.
volumes:
- ./data/bookkeeper:/pulsar/data/bookkeeper
command: bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf
&& exec bin/pulsar bookie"
# Start broker
broker:
image: apachepulsar/pulsar:latest
profiles: ["pulsar"]
container_name: broker
hostname: broker
restart: on-failure
networks:
- pulsar
environment:
- metadataStoreUrl=zk:zookeeper:2181
- zookeeperServers=zookeeper:2181
- clusterName=cluster-a
- managedLedgerDefaultEnsembleSize=1
- managedLedgerDefaultWriteQuorum=1
- managedLedgerDefaultAckQuorum=1
- advertisedAddress=broker
- advertisedListeners=external:pulsar://127.0.0.1:6650
depends_on:
zookeeper:
condition: service_healthy
bookie:
condition: service_started
ports:
- "6650:6650"
- "8080:8080"
volumes:
- ./connectors/pulsar:/pulsar/connectors
command: bash -c "bin/apply-config-from-env.py conf/broker.conf
&& exec bin/pulsar broker"
# MySQL8
db:
image: mysql:8
hostname: mysqldb
container_name: mysqldb
cap_add:
- SYS_NICE
restart: always
environment:
- MYSQL_DATABASE=reservas
- MYSQL_ROOT_PASSWORD=adminadmin
profiles: ["aeroalpes", "db"]
networks:
- pulsar
ports:
- '3306:3306'
volumes:
- ./data/mysql:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
# Servicios de AeroAlpes
aeroalpes:
container_name: aeroalpes
hostname: aeroalpes
image: aeroalpes/flask
profiles: ["aeroalpes", "monolito"]
networks:
- sidecar
- pulsar
labels:
SidecarDiscover: "false"
depends_on:
- broker
- db
environment:
- AEROALPES_ADDRESS=aeroalpes
- PULSAR_ADDRESS=broker
ports:
- "5000:5000"
adaptador:
image: "aeroalpes/adaptador"
profiles: ["aeroalpes", "monolito"]
container_name: adaptador
hostname: adaptador
depends_on:
- aeroalpes
networks:
- sidecar
environment:
- AEROALPES_ADDRESS=aeroalpes
- PULSAR_ADDRESS=broker
ports:
- "50051:50051"
# Servicios de Notificación
notificacion:
container_name: notificacion
hostname: notificacion
image: aeroalpes/notificacion
profiles: ["aeroalpes", "notificacion"]
depends_on:
- aeroalpes
- broker
environment:
- AEROALPES_ADDRESS=aeroalpes
- PULSAR_ADDRESS=broker
networks:
- pulsar
# Servicio BFF
bff:
container_name: bff
hostname: bff
image: aeroalpes/bff
profiles: ["aeroalpes", "bff"]
depends_on:
- aeroalpes
- broker
environment:
- AEROALPES_ADDRESS=aeroalpes
- BROKER_HOST=broker
networks:
- pulsar
ports:
- "8003:8003"
# Servicio Cliente
cliente:
container_name: cliente
hostname: cliente
image: aeroalpes/cliente
profiles: ["aeroalpes", "cliente"]
depends_on:
- aeroalpes
- broker
environment:
- AEROALPES_ADDRESS=aeroalpes
- BROKER_HOST=broker
networks:
- pulsar
ports:
- "8000:8000"
# Servicio Pagos
pagos:
container_name: pagos
hostname: pagos
image: aeroalpes/pagos
profiles: ["aeroalpes", "pagos"]
depends_on:
- aeroalpes
- broker
environment:
- AEROALPES_ADDRESS=aeroalpes
- BROKER_HOST=broker
networks:
- pulsar
ports:
- "8001:8001"
# Servicio GDS
gds:
container_name: gds
hostname: gds
image: aeroalpes/gds
profiles: ["aeroalpes", "gds"]
depends_on:
- aeroalpes
- broker
environment:
- AEROALPES_ADDRESS=aeroalpes
- BROKER_HOST=broker
networks:
- pulsar
ports:
- "8002:8002"