This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
109 lines (103 loc) · 3.08 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
version: '3.7'
services:
rocketchat:
image: rocketchat/rocket.chat:latest
container_name: rocketchat
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)"
restart: unless-stopped
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=https://${DOMAIN?Variable DOMAIN not set}
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
env_file:
- .env
depends_on:
- mongo
networks:
- default
- traefik-public
labels:
- "traefik.frontend.rule=Host:${DOMAIN?Variable DOMAIN not set}"
- "traefik.enable=true"
- "traefik.port=3000"
- "traefik.tags=traefik"
- "traefik.docker.network=traefik-public"
- "traefik.servicehttp.frontend.entryPoints=http"
- "traefik.servicehttp.frontend.redirect.entryPoint=https"
- "traefik.servicehttps.frontend.entryPoints=https"
- "traefik.servicehttps.frontend.redirect.regex=^https?://(www.)?(${DOMAIN})/(.*)"
- "traefik.servicehttps.frontend.redirect.replacement=https://${DOMAIN}/$$3"
mongo:
image: mongo:4.0
container_name: mongo
restart: unless-stopped
networks:
- default
volumes:
- ./data/db:/data/db
- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
# this container's job is just run the command to initialize the replica set.
# it will run the command and remove himself (it will not stay running)
mongo-init-replica:
image: mongo:4.0
command: >
bash -c
"for i in `seq 1 30`; do
mongo mongo/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:
- mongo
networks:
- default
traefik:
image: traefik:alpine
container_name: traefik
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${HOME}/acme.json:/acme.json
networks:
- default
- traefik-public
command: >
--debug=false
--logLevel=INFO
--defaultentrypoints=https,http
--entryPoints='Name:http Address::80 Redirect.EntryPoint:https'
--entryPoints='Name:https Address::443 TLS'
--retry
--docker.endpoint=unix:///var/run/docker.sock
--docker.domain=${DOMAIN?Variable DOMAIN not set}
--docker.watch=true
--docker.exposedbydefault=false
--acme.email=${EMAIL?Variable EMAIL not set}
--acme.storage=acme.json
--acme.entryPoint=https
--acme.onHostRule=true
--acme.httpChallenge.entryPoint=http
--acme.acmelogging=true
--accessLog
--api
networks:
traefik-public:
external: true