-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
220 lines (208 loc) · 7.52 KB
/
docker-compose.yaml
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
version: '3'
services:
axon-server:
container_name: axon-server
image: axoniq/axonserver:4.6.4-jdk-17-dev
networks:
- fastcampuspay_network
ports:
- "8024:8024"
- "8124:8124"
volumes:
- axonserver-data:/axonserver/data
- axonserver-events:/axonserver/events
- axonserver-config:/axonserver/config:ro
mysql:
image: mysql:8.0
networks:
- fastcampuspay_network
volumes: # :앞 경로 파일이 :뒤 경로 파일(컨테이너 내)과 매핑/동기화 된다
- ./db/conf.d:/etc/mysql/conf.d
- ./db/data:/var/lib/mysql
- ./db/initdb.d:/docker-entrypoint-initdb.d
env_file: .env # mysql 의 환경변수는 이 파일에서 지정하겠다
ports:
- "3307:3306"
environment:
- TZ=Asia/Seoul
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_USER=mysqluser
- MYSQL_PASSWORD=mysqlpw
membership-service:
image: yujapay-membership-service:1.0.0
networks:
- fastcampuspay_network
ports: #8081->8080 포트포워딩 한다. (좌측: os레벨에서 컨테이너까지 매핑될 포트 / 우측:컨테이너 안 실제 애플리케이션 포트)
- "8081:8080"
depends_on: # 이게 실행되어야 membership-service 가 실행될 수 있다.
- mysql
environment: # application.properties(docker desktop 환경변수) 적는 부분
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
money-service:
image: yujapay-money-service:1.0.0
networks:
- fastcampuspay_network
ports:
- "8083:8080"
depends_on:
- mysql
environment:
- AXON_AXONSERVER_SERVERS=axon-server:8124
- AXON_SERIALIZER_EVENTS=jackson
- AXON_SERIALIZER_MESSAGES=jackson
- AXON_SERIALIZER_GENERAL=xstream
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
- TASK_TOPIC=fastcampus.task.topic
- TASK_RESULT_TOPIC=fastcampus.task.result.topic
- SERVICE_MEMBERSHIP_URL=http://membership-service:8080
banking-service:
image: yujapay-banking-service:1.0.0
networks:
- fastcampuspay_network
ports:
- "8082:8080"
depends_on:
- mysql
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
- TASK_TOPIC=fastcampus.task.topic
- SERVICE_MEMBERSHIP_URL=http://membership-service:8080 # 컨테이너 입장에서의 포트
zookeeper:
image: 'arm64v8/zookeeper:3.8'
networks:
- fastcampuspay_network
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOO_TLS_CLIENT_AUTH=none
- ZOO_TLS_QUORUM_CLIENT_AUTH=none
kafka:
image: 'bitnami/kafka:3.4.0'
networks:
- fastcampuspay_network
ports:
- '9092:9092'
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER # 추가
- KAFKA_CFG_LISTENERS=LC://kafka:29092,LX://kafka:9092,CONTROLLER://:9093 # CONTROLLER 추가
- KAFKA_CFG_ADVERTISED_LISTENERS=LC://kafka:29092,LX://${DOCKER_HOST_IP:-localhost}:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=LC:PLAINTEXT,LX:PLAINTEXT,CONTROLLER:PLAINTEXT # CONTROLLER 추가
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=LC
depends_on: # 주키퍼 올라간 후 카프카 실행
- zookeeper
kafka-ui:
image: provectuslabs/kafka-ui
container_name: kafka-ui
networks:
- fastcampuspay_network
ports:
- "8989:8080"
restart: always
depends_on:
- kafka
- zookeeper
environment:
- KAFKA_CLUSTERS_0_NAME=local
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:29092
- KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2181
logging-consumer:
image: yujapay-logging-consumer:1.0.0
networks:
- fastcampuspay_network
restart: always
depends_on:
- kafka
- zookeeper
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
- TASK_RESULT_TOPIC=fastcampus.task.result.topic
task-consumer:
image: yujapay-task-consumer:1.0.0
networks:
- fastcampuspay_network
restart: always
depends_on:
- kafka
- zookeeper
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
- TASK_TOPIC=fastcampus.task.topic
- TASK_RESULT_TOPIC=fastcampus.task.result.topic
remittance-service:
image: yujapay-remittance-service:1.0.0
networks:
- fastcampuspay_network
ports:
- "8084:8080"
restart: always
depends_on:
- kafka
- mysql
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/yuja_pay?useSSL=false&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=mysqluser
- SPRING_DATASOURCE_PASSWORD=mysqlpw
- SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT=org.hibernate.dialect.MySQLDialect
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
- KAFKA_CLUSTERS_BOOTSTRAPSERVERS=kafka:29092
- LOGGING_TOPIC=fastcampus.logging.out.stdout
- SERVICE_MEMBERSHIP_URL=http://membership-service:8080
- SERVICE_BANKING_URL=http://banking-service:8080
- SERVICE_MONEY_URL=http://money-service:8080
volumes:
axonserver-data:
driver: local
driver_opts:
o: bind
type: none
device: ${PWD}/axon-server-se/data
axonserver-events:
driver: local
driver_opts:
o: bind
type: none
device: ${PWD}/axon-server-se/events
axonserver-config:
driver: local
driver_opts:
o: bind
type: none
device: ${PWD}/axon-server-se/config
# 브릿지 드라이버 사용해서 패스트캠퍼스페이 네트워크를 사용할거다라는 의미 (이 네트워크를 위 services 에서 사용함)
networks:
fastcampuspay_network:
driver: bridge