-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
73 lines (66 loc) · 2.21 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
networks:
go-transactional-outbox-network:
driver: bridge
volumes:
kafka_data:
x-go-service: &go-run-service
image: golang:1.23.2-alpine3.20
tty: true
command: go run .
volumes:
- ./:/go-transactional-outbox/app:Z
networks:
- go-transactional-outbox-network
depends_on:
- db
- broker
environment:
POSTGRES_DSN: "postgresql://go-transactional-outbox:go-transactional-outbox@db:5432/go-transactional-outbox?sslmode=disable"
KAFKA_SEEDS: broker:9092
services:
db:
image: postgres:16.3-alpine
container_name: go-transactional-outbox-db
restart: unless-stopped
ports:
- 5432:5432
networks:
- go-transactional-outbox-network
environment:
POSTGRES_USER: go-transactional-outbox
POSTGRES_PASSWORD: go-transactional-outbox
POSTGRES_DB: go-transactional-outbox
broker:
image: docker.io/bitnami/kafka:3.8.1
container_name: go-transactional-outbox-broker
restart: unless-stopped
ports:
- 9092:9092
networks:
- go-transactional-outbox-network
volumes:
- ./kafka_data:/bitnami:Z
- ./:/app:Z
environment:
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@broker:9093
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
order-service:
<<: *go-run-service
container_name: go-transactional-outbox-order-service
working_dir: /go-transactional-outbox/app/order-service/cmd
message-relay-service:
<<: *go-run-service
container_name: go-transactional-outbox-message-relay-service
working_dir: /go-transactional-outbox/app/message-relay-service/cmd
restart: unless-stopped
inventory-service:
<<: *go-run-service
container_name: go-transactional-outbox-inventory-service
working_dir: /go-transactional-outbox/app/inventory-service/cmd
restart: unless-stopped