forked from morlfm/mux-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
150 lines (137 loc) · 3.75 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
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
version: '3.8'
services:
parser:
image: morlfm/parser:v1.0.1
restart: on-failure
depends_on:
rabbitmq:
condition: service_started
networks:
- m_network
ports:
- "8082:8082"
environment:
KAFKA_BROKER: broker:9092
ZOOKEEPER: zookeeper:2181
RABBITMQ_HOST: rabbitmq:5672
POSTGRES_HOST: db:5432
db:
image: postgres:12-alpine
container_name: employees
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=000
- TZ=UTC
volumes:
- "repository:/var/lib/postgresql/data"
- "./adapters/repository/init.sql:/docker-entrypoint-initdb.d/create_tables.sql"
networks:
- m_network
# zookeeper:
# image: confluentinc/cp-zookeeper:7.5.1
# container_name: m_zookeeper
# environment:
# ZOOKEEPER_CLIENT_PORT: 2181
# ZOOKEEPER_TICK_TIME: 2000
# networks:
# - m_network
# broker:
# image: confluentinc/cp-kafka:7.5.1
# container_name: mux_broker
# ports:
# - "9092:9092"
# expose:
# - '29092'
# depends_on:
# - zookeeper
# environment:
# KAFKA_BROKER_ID: 1
# KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
# KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
# KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
# networks:
# - m_network
# kafka:
# image: confluentinc/cp-kafka:7.5.1
# container_name: mux-kafka
# restart: always
# depends_on:
# broker:
# condition: service_started
# zookeeper:
# condition: service_started
# entrypoint: [ '/bin/sh', '-c' ]
# command: |
# "
# # blocks until kafka is reachable
# kafka-topics --bootstrap-server broker:29092 --list
# echo -e 'Creating kafka topics'
# kafka-topics --bootstrap-server broker:29092 --create --if-not-exists --topic tmr-events --replication-factor 1 --partitions 1
# kafka-topics --bootstrap-server broker:29092 --create --if-not-exists --topic mr-event-log --replication-factor 1 --partitions 1
# echo -e 'Successfully created the following topics:'
# kafka-topics --bootstrap-server broker:29092 --list
# "
# environment:
# # - KAFKA_ADVERTISED_HOST_NAME=kafka
# # - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
# # - KAFKA_CREATE_TOPICS=employees:1:1
# # - TZ=UTC
# KAFKA_BROKER_ID: ignored
# KAFKA_ZOOKEEPER_CONNECT: ignored
# networks:
# - m_network
# wiremock:
# image: wiremock/wiremock:2.32.0-alpine
# container_name: mux_wiremock
# ports:
# - "8091:8080"
# volumes:
# - "./wiremock:/home/wiremock"
# networks:
# - m_network
rabbitmq:
image: rabbitmq:3.8.9-management
container_name: rabbitmq
restart: always
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
- TZ=UTC
networks:
- m_network
server:
image: morlfm/server:v1.1.0
# build:
# context: .
# dockerfile: Dockerfile
restart: on-failure
ports:
- "8081:8081"
depends_on:
db:
condition: service_started
rabbitmq:
condition: service_started
environment:
# KAFKA_BROKER: broker:9092
# ZOOKEEPER: zookeeper:2181
RABBITMQ_HOST: rabbitmq:5672
POSTGRES_HOST: db:5432
networks:
- m_network
volumes:
repository:
driver: local
networks:
m_network:
driver: bridge
name: m_network