-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
162 lines (149 loc) · 3.1 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
151
152
153
154
155
156
157
158
159
160
161
162
version: '2.1'
services:
# Uncomment this to enable superchat/llm in the app
# ollama:
# container_name: llm-model
# build: ./llm
# ports:
# - "${LLM_PORT}:11434"
# env_file:
# - .env
# volumes:
# - ollama_data:/root/.ollama
# networks:
# - chat-network
nginx:
container_name: nginx-reverse-proxy
image: nginx:latest
ports:
- "${NGINX_PORT}:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- frontend
- app1
- app2
- app3
networks:
- chat-network
frontend:
container_name: frontend
build:
context: ./web
dockerfile: Dockerfile
args:
- NGINX_ENV=${NGINX_ENV}
- NGINX_HOST=${NGINX_HOST}
- NGINX_PORT=${NGINX_PORT}
env_file:
- .env
networks:
- chat-network
app1:
container_name: app1
build: .
env_file:
- .env
environment:
- SERVER_NAME=Asia
networks:
- chat-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
app2:
container_name: app2
build: .
env_file:
- .env
environment:
- SERVER_NAME=Middle-east
networks:
- chat-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
app3:
container_name: app3
build: .
env_file:
- .env
environment:
- SERVER_NAME=Europe
networks:
- chat-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
postgres:
container_name: postgres
image: postgres:14
environment:
POSTGRES_DB: ${POSTGRES_DATABASE}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
env_file:
- .env
ports:
- "${POSTGRES_PORT}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DATABASE}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- chat-network
redis:
container_name: redis
image: redis
ports:
- "${REDIS_PORT}:6379"
networks:
- chat-network
zookeeper:
container_name: zookeeper
image: wurstmeister/zookeeper
ports:
- "${ZOOKEEPER_PORT}:2181"
networks:
- chat-network
kafka:
container_name: kafka
image: wurstmeister/kafka
ports:
- "${KAFKA_PORT}:9092"
environment:
- KAFKA_ADVERTISED_HOST_NAME=kafka
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
networks:
- chat-network
kafka-consumer:
container_name: kafka-consumer
build:
context: ./kafka-consumer
dockerfile: Dockerfile
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_started
zookeeper:
condition: service_started
networks:
- chat-network
volumes:
ollama_data:
postgres_data:
networks:
chat-network:
driver: bridge