-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
170 lines (136 loc) · 3.37 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
version: '3.9'
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- '5672:5672'
- '15672:15672'
networks:
- broker-clickhouse
- local
clickhouse:
image: yandex/clickhouse-server:latest
ports:
- "8123:8123"
- "9000:9000"
- "9009:9009"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
networks:
- broker-clickhouse
ulimits:
nproc: 65535
nofile:
soft: 262144
hard: 262144
migrate:
image: migrate/migrate
depends_on:
clickhouse:
condition: service_healthy
networks:
- broker-clickhouse
volumes:
- ./clickhouse/migrate:/migrations
command:
[ "-database",
"clickhouse://clickhouse:9000?username=default&database=default&x-multi-statement=true",
"-path", "/migrations", "up" ]
mongodb:
networks:
- local
image: mongo:5.0
ports:
- "27017:27017"
volumes:
- 'mongo-data:/data/db'
healthcheck:
test: mongosh --eval 'db.runCommand("ping").ok'
interval: 2s
timeout: 30s
environment:
- MONGO_INITDB_ROOT_USERNAME=server
- MONGO_INITDB_ROOT_PASSWORD=pass
redis:
networks:
- local
restart: on-failure
image: "redis:latest"
command: redis-server --port 6379
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 2s
timeout: 2s
retries: 10
ports:
- "6379:6379"
volumes:
- mongo-data:/var/lib/redis
environment:
REDIS_REPLICATION_MODE: master
app:
healthcheck:
test: wget --spider http://localhost:8082/healthcheck
interval: 1m
depends_on:
mongodb:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
networks:
- local
build:
# context: ./server
dockerfile: Dockerfile
volumes:
- "app-logs:/logs"
command:
- "-log=/logs/log.txt"
ports:
- "8080:8080"
- "8082:8082"
env_file: .env
environment:
- TIME_ZONE=Europe/France
### MongoDB
- MONGODB_URI=mongodb://server:pass@mongodb:27017/?authSource=admin
- MONGODB_DATABASE=lake
- MONGODB_COLLECTION=items
- MONGODB_CONNECT_TIMEOUT=10s
### Redis
- REDIS_ADDRESSES=redis:6379
- REDIS_POOL_TIMEOUT=5s
### RabbitMQ
- RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672/
- RABBITMQ_EXCHANGE=events
- RABBITMQ_KEY=actions
- RABBITMQ_PERSISTENT_DELIVERY_MODE=true
# if empty, a random queue name will be generated
- RABBITMQ_QUEUE_NAME=
- RABBITMQ_QUEUE_DURABLE=true
- RABBITMQ_QUEUE_AUTODELETE=false
- RABBITMQ_QUEUE_EXCLUSIVE=false
- RABBITMQ_QUEUE_NOWAIT=true
- RABBITMQ_EXCHANGE_NAME=events
# exchange type: direct, fanout, topic, headers
- RABBITMQ_EXCHANGE_KIND=fanout
- RABBITMQ_EXCHANGE_DURABLE=true
- RABBITMQ_EXCHANGE_AUTO_DELETE=false
# Internal must be false
- RABBITMQ_EXCHANGE_INTERNAL=false
- RABBITMQ_EXCHANGE_NO_WAIT=false
### gRPC
- GRPC_PORT=8080
### HTTP
- HTTP_PORT=8082
networks:
broker-clickhouse:
driver: bridge
local:
driver: bridge
volumes:
redis-data:
mongo-data:
app-logs: