-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
88 lines (78 loc) · 2.13 KB
/
docker-compose.yaml
File metadata and controls
88 lines (78 loc) · 2.13 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
version: '3.8'
networks:
smartcache-net:
driver: bridge
volumes:
timescale_data:
services:
# ------------------ Gateway (Public) ------------------
gateway:
build: ./gateway/api-gateway
ports:
- "8080:8080" # Only this is exposed outside
environment:
- REDIS_INTERNAL_HOST=internal-redis:6379
- KAFKA_BROKER=kafka:9092
depends_on:
- internal-redis
- kafka
- timescaledb
networks:
- smartcache-net
# ------------------ Internal Redis ------------------
internal-redis:
image: redis:7
networks:
- smartcache-net
# ------------------ Zookeeper ------------------
zookeeper:
image: bitnami/zookeeper:3.9
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
- smartcache-net
# ------------------ Kafka ------------------
kafka:
image: bitnami/kafka:3.6
environment:
- KAFKA_BROKER_ID=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_LISTENERS=PLAINTEXT://:9092
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
depends_on:
- zookeeper
networks:
- smartcache-net
# ------------------ TimescaleDB ------------------
timescaledb:
image: timescale/timescaledb:2.14.2-pg15
environment:
POSTGRES_USER: smartcache
POSTGRES_PASSWORD: smartcache123
POSTGRES_DB: smartcache
volumes:
- timescale_data:/var/lib/postgresql/data
networks:
- smartcache-net
# ------------------ Database-Updater (Go Service) ------------------
db-updater:
build:
context: ./consumers/Database-Updater
dockerfile: Dockerfile
depends_on:
- kafka
- timescaledb
networks:
- smartcache-net
# ------------------ DB Migrator (Runs migrations after DB is ready) ------------------
db-migrator:
build:
context: ./database
dockerfile: Dockerfile
depends_on:
- timescaledb
networks:
- smartcache-net
restart: "on-failure"