uploads directory, update docker-compose w/ mmap migration to wiredTiger
This commit is contained in:
parent
cf2111fac3
commit
8810ceb49e
|
@ -1,15 +1,14 @@
|
||||||
version: '2'
|
version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
rocketchat:
|
rocketchat:
|
||||||
# image: registry.rocket.chat/rocketchat/rocket.chat:latest
|
image: rocket.chat:4.0.3
|
||||||
image: rocket.chat:4.0
|
|
||||||
command: >
|
command: >
|
||||||
bash -c
|
bash -c
|
||||||
"for i in `seq 1 30`; do
|
"for (( ; ; )); do
|
||||||
node main.js &&
|
node main.js &&
|
||||||
s=$$? && break || s=$$?;
|
s=$$? && break || s=$$?;
|
||||||
echo \"Tried $$i times. Waiting 5 secs...\";
|
echo \"Could not start Rocket.Chat. Waiting 5 secs...\";
|
||||||
sleep 5;
|
sleep 5;
|
||||||
done; (exit $$s)"
|
done; (exit $$s)"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -20,10 +19,7 @@ services:
|
||||||
- ROOT_URL=http://localhost:3000
|
- ROOT_URL=http://localhost:3000
|
||||||
- MONGO_URL=mongodb://mongo:27017/rocketchat
|
- MONGO_URL=mongodb://mongo:27017/rocketchat
|
||||||
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
|
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
|
||||||
- REG_TOKEN=${REG_TOKEN}
|
- MAIL_URL=smtp://smtp.email
|
||||||
# - MAIL_URL=smtp://smtp.email
|
|
||||||
# - HTTP_PROXY=http://proxy.domain.com
|
|
||||||
# - HTTPS_PROXY=http://proxy.domain.com
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongo
|
- mongo
|
||||||
ports:
|
ports:
|
||||||
|
@ -36,59 +32,37 @@ services:
|
||||||
image: mongo:4.0
|
image: mongo:4.0
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/db:/data/db
|
- ./data/db:/data/db
|
||||||
- ./data/dump:/dump
|
- ./data/dump:/dump
|
||||||
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
|
command: >
|
||||||
|
bash -c
|
||||||
|
"while [ ! -f /data/db/WiredTiger ]; do
|
||||||
|
echo \"wiredTiger migration hasn't started yet. Waiting 30 secs...\";
|
||||||
|
sleep 30;
|
||||||
|
done;
|
||||||
|
docker-entrypoint.sh mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger;"
|
||||||
|
depends_on:
|
||||||
|
- migrator
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=false"
|
- "traefik.enable=false"
|
||||||
|
|
||||||
# this container's job is just run the command to initialize the replica set.
|
migrator:
|
||||||
# it will run the command and remove himself (it will not stay running)
|
build: ./docker/
|
||||||
|
volumes:
|
||||||
|
- ./data/db:/data/db
|
||||||
|
|
||||||
mongo-init-replica:
|
mongo-init-replica:
|
||||||
image: mongo:4.0
|
image: mongo:4.0
|
||||||
command: >
|
command: >
|
||||||
bash -c
|
bash -c
|
||||||
"for i in `seq 1 30`; do
|
"for (( ; ; )); do
|
||||||
mongo mongo/rocketchat --eval \"
|
mongo mongo/rocketchat --eval \"
|
||||||
rs.initiate({
|
rs.initiate({
|
||||||
_id: 'rs0',
|
_id: 'rs0',
|
||||||
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
|
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
|
||||||
s=$$? && break || s=$$?;
|
s=$$? && break || s=$$?;
|
||||||
echo \"Tried $$i times. Waiting 5 secs...\";
|
echo \"Could not reach MongoDB. Waiting 5 secs ...\";
|
||||||
sleep 5;
|
sleep 5;
|
||||||
done; (exit $$s)"
|
done; (exit $$s)"
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongo
|
- mongo
|
||||||
- nginx
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
image: nginx:latest
|
|
||||||
container_name: webserver
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
volumes:
|
|
||||||
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
- ./nginx/ssl/:/ssl/
|
|
||||||
- ./nginx/ssl/:/etc/nginx/
|
|
||||||
#traefik:
|
|
||||||
# image: traefik:latest
|
|
||||||
# restart: unless-stopped
|
|
||||||
# command: >
|
|
||||||
# traefik
|
|
||||||
# --docker
|
|
||||||
# --acme=true
|
|
||||||
# --acme.domains='your.domain.tld'
|
|
||||||
# --acme.email='your@email.tld'
|
|
||||||
# --acme.entrypoint=https
|
|
||||||
# --acme.storagefile=acme.json
|
|
||||||
# --defaultentrypoints=http
|
|
||||||
# --defaultentrypoints=https
|
|
||||||
# --entryPoints='Name:http Address::80 Redirect.EntryPoint:https'
|
|
||||||
# --entryPoints='Name:https Address::443 TLS.Certificates:'
|
|
||||||
# ports:
|
|
||||||
# - 80:80
|
|
||||||
# - 443:443
|
|
||||||
# volumes:
|
|
||||||
# - /var/run/docker.sock:/var/run/docker.sock
|
|
|
@ -31,6 +31,14 @@
|
||||||
group: "{{ main_user }}"
|
group: "{{ main_user }}"
|
||||||
mode: 0775
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Creates directory structure for upload data
|
||||||
|
file:
|
||||||
|
path: /home/{{ main_user }}/rocketchat/uploads
|
||||||
|
state: directory
|
||||||
|
owner: "{{ main_user }}"
|
||||||
|
group: "{{ main_user }}"
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
- name: copy docker compose to server
|
- name: copy docker compose to server
|
||||||
become_user: "{{ main_user }}"
|
become_user: "{{ main_user }}"
|
||||||
copy:
|
copy:
|
||||||
|
|
Loading…
Reference in New Issue