-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (73 loc) · 1.97 KB
/
docker-compose.yml
File metadata and controls
76 lines (73 loc) · 1.97 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
services:
# MongoDB — база данных для Rocket.Chat
db:
image: mongodb/mongodb-community-server:${MONGODB_VERSION:-8.0}-ubi8
platform: linux/amd64
container_name: rocketchat-mongo
restart: unless-stopped
volumes:
- mongodb_data:/data/db
- mongodb_dump:/dump
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=rocketchat
command: mongod --replSet rs0 --bind_ip_all
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Инициализация репликасета
db-init:
image: mongodb/mongodb-community-server:${MONGODB_VERSION:-8.0}-ubi8
platform: linux/amd64
container_name: rocketchat-mongo-init
depends_on:
db:
condition: service_healthy
restart: "no"
command: >
mongosh --host db:27017 --eval '
try {
rs.initiate({
_id: "rs0",
members: [{ _id: 0, host: "db:27017" }]
});
print("Replica set initialized");
} catch (e) {
print("Replica set may already be initialized: " + e);
}
return 0;
'
# Rocket.Chat
rocketchat:
image: rocketchat/rocket.chat:${ROCKETCHAT_VERSION:-8.1.1}
platform: linux/amd64
container_name: rocketchat-server
restart: unless-stopped
ports:
- "3000:3000"
environment:
- TEST_MODE=true
- PORT=3000
- MONGO_URL=mongodb://db:27017/rocketchat?replicaSet=rs0
- MAX_FILE_SIZE=10485760
- LOG_LEVEL=info
- DEPLOY_METHOD=docker
depends_on:
db:
condition: service_healthy
healthcheck:
test: curl -f http://localhost:3000/api/info || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
volumes:
- rocketchat_uploads:/app/uploads
volumes:
mongodb_data:
mongodb_dump:
rocketchat_uploads: