-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
114 lines (114 loc) · 2.63 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
version: "3.9"
services:
config:
build:
context: .
dockerfile: Dockerfile
depends_on:
- broker
- postgres
command: sh -c "
sleep 4 &&
./bin/notifi"
environment:
BROKERS: broker:9092
DSN: postgres://postgres:password@postgres:5432/notifi
REQUEST_TOPIC: notifi-request
ports:
- "8080:8080"
- "8081:8081"
router:
build:
context: .
dockerfile: Dockerfile.router
depends_on:
- broker
- postgres
command: sh -c "
sleep 4 &&
./bin/router"
environment:
BROKERS: broker:9092
DSN: postgres://postgres:password@postgres:5432/notifi
REQUEST_TOPIC: notifi-request
DELIVERY_TOPIC: notifi-delivery
delivery:
build:
context: .
dockerfile: Dockerfile.delivery
depends_on:
- broker
- postgres
command: sh -c "
sleep 4 &&
./bin/delivery"
environment:
BROKERS: broker:9092
DSN: postgres://postgres:password@postgres:5432/notifi
DELIVERY_TOPIC: notifi-delivery
FROM_NAME: notifi
FROM_EMAIL: [email protected]
SENDGRID_KEY: 123
TWILIO_SID: abc
TWILIO_TOKEN: 123
FROM_NUMBER: 18005551234
SKIP_DELIVERY: true
REDIS_HOST: redis:6379
REDIS_TTL: 1h
poller:
build:
context: .
dockerfile: Dockerfile.poller
depends_on:
- broker
- postgres
command: sh -c "
sleep 4 &&
./bin/poller"
environment:
BROKERS: broker:9092
DSN: postgres://postgres:password@postgres:5432/notifi
DELIVERY_TOPIC: notifi-delivery
POLL_INTERVAL: 1m
#TODO remove zookeeper and upgrade to kraft
zookeeper:
image: bitnami/zookeeper:latest
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
ALLOW_ANONYMOUS_LOGIN: yes
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker:
container_name: broker
hostname: broker
image: bitnami/kafka:latest
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092
postgres:
container_name: postgres
hostname: postgres
build:
context: sql
dockerfile: Dockerfile
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: notifi
ports:
- "5432:5432"
redis:
container_name: redis
hostname: redis
image: redis:7.0.7
ports:
- "6379:6379"