-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
rocketchat.yml
146 lines (137 loc) · 4.21 KB
/
rocketchat.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
version: '3.8'
x-rocketchat-labels: &rocketchat-labels
labels:
- traefik.enable=true
- traefik.docker.network=monitoring
- traefik.http.routers.rocketchat-http.rule=Host(`rocketchat.${DOMAIN?Variable not set}`)
- traefik.http.routers.rocketchat-http.entrypoints=http
#- traefik.http.routers.rocketchat-http.middlewares=admin-auth
- traefik.http.routers.rocketchat-http.service=rocketchat
- traefik.http.routers.rocketchat-http.middlewares=https-redirect
- traefik.http.routers.rocketchat-https.rule=Host(`rocketchat.${DOMAIN?Variable not set}`)
- traefik.http.routers.rocketchat-https.entrypoints=https
#- traefik.http.routers.rocketchat-https.middlewares=admin-auth
- traefik.http.routers.rocketchat-https.tls=true
- traefik.http.routers.rocketchat-https.service=rocketchat
- traefik.http.routers.rocketchat-https.tls.certresolver=le
- traefik.http.services.rocketchat.loadbalancer.server.port=3000
x-service: &service
logging:
driver: json-file
options:
max-size: "100m"
max-file: "2"
restart: always
networks:
- rocketchat
services:
# https://docs.rocket.chat/quick-start/installing-and-updating/rapid-deployment-methods/docker-and-docker-compose
# https://docs.rocket.chat/quick-start/accessing-your-workspace/creating-the-first-administrator
rocketchat:
container_name: rocketchat
image: registry.rocket.chat/rocketchat/rocket.chat
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.01'
memory: 656M
<<: *rocketchat-labels
<<: *rocketchat-labels
<<: *service
environment:
PORT: 3000
ROOT_URL: "https://rocketchat.${DOMAIN?Variable not set}"
MONGO_URL: "mongodb://rocketchat-mongodb:27017/rocketchat"
MONGO_OPLOG_URL: "mongodb://rocketchat-mongodb:27017/local"
#REG_TOKEN: ${REG_TOKEN}
#MAIL_URL: smtp://smtp.email
#HTTP_PROXY: http://proxy.domain.com
#HTTPS_PROXY: http://proxy.domain.com
depends_on:
- rocketchat-mongodb
volumes:
- rocketchat-data:/app/uploads
command: >
bash -c
"for i in `seq 1 30`; do
node main.js &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 secs...\";
sleep 5;
done; (exit $$s)"
user: root
rocketchat-mongodb:
container_name: rocketchat-mongodb
image: mongo:4.0
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.01'
memory: 50M
placement:
constraints:
- node.hostname == ${HOSTNAME?Variable HOSTNAME not set}
<<: *service
volumes:
- rocketchat-mongodb-data:/data/db
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
user: root
rocketchat-mongodb-init:
container_name: rocketchat-mongodb-init
image: mongo:4.0
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.01'
memory: 50M
placement:
constraints:
- node.hostname == ${HOSTNAME?Variable HOSTNAME not set}
<<: *service
restart: on-failure
volumes:
- rocketchat-mongodb-data:/data/db
command: >
bash -c
"for i in `seq 1 30`; do
mongo rocketchat-mongodb/rocketchat --eval \"
rs.initiate({
_id: 'rs0',
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 secs...\";
sleep 5;
done; (exit $$s)"
depends_on:
- rocketchat-mongodb
user: root
x-volume: &volume
driver: local
x-volume-driver-opts: &volume-driver-opts
type: none
o: bind
volumes:
rocketchat-mongodb-data:
name: rocketchat-mongodb-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/rocketchat-mongodb/data
rocketchat-data:
name: rocketchat-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/rocketchat/data
x-network: &network
external: true
networks:
rocketchat:
name: rocketchat
<<: *network