Description
Im trying to update my docker based Rocketchat containers following the official Rocketchat instructions
I want to upgrade from 4.2.0 to 4.8.1
The issue is that the command “sudo docker-compose stop rocketchat” goes through without giving me an error, but doesnt actually stop the rocketchat-related containers.
When I do an “sudo docker ps” after this, it tells me that the Rocketchat-Containers are still running.
and with “sudo docker-compose rm rocketchat” it only removes the weird “zmwadmin_rocketchat_1” container.
After that, the container default_rocketchat_1 does still exist and is running:
This makes it kinda impossible for me to update our Rocketchat-Containers.
Ive already tried removing the containers manually with “sudo docker rm default_rocketchat_1”, then building version 4.8.1 with “sudo-docker-compose up -d”, but this results in my Nginx Reverse Proxy giving me the message “502 Bad Gateway”.
Im not sure how I could fix this issue.
The docker-containers are stored directly in the Home-Path of user “zmwadmin”: /home/zmwadmin/
As well as the docker-compose file: /home/zmwadmin/docker-compose.yml
Server Setup Information
- Version of Rocket.Chat Server:
- Operating System: Ubuntu 22.04 LTS
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: v12.22.1
- MongoDB Version: 4.0.19 / mmapv1 (oplog activated)
- Proxy: Local Reverse Proxy is Nginx
- Firewalls involved: probably not
Any additional Information
My docker-compose.yml:
Blockquote
version: ‘2’
services:
rocketchat:
image: rocketchat/rocket.chat:4.2.0
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=…
- MONGO_URL=…
- MONGO_OPLOG_URL=…
- MAIL_URL=…
- HTTP_PROXY=…
- HTTPS_PROXY=…
depends_on:
- mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: your.domain.tld"
mongo:
image: mongo:4.0
restart: unless-stopped
volumes:
- ./data/db:/data/db
#- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
labels:
- “traefik.enable=false”
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
hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
image: rocketchat/hubot-rocketchat:latest
restart: unless-stopped
environment:
- ROCKETCHAT_URL=this.ismydomain
- ROCKETCHAT_ROOM=GENERAL
- ROCKETCHAT_USER=bot
- ROCKETCHAT_PASSWORD=botpassword
- BOT_NAME=bot
you can add more scripts as you’d like here, they need to be installable by npm
- EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
depends_on:
- rocketchat
labels:
- "traefik.enable=false"
volumes:
- ./scripts:/home/hubot/scripts
this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
ports:
- 3001:8080
#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
zmwadmin@zmwrc:~$ version: ‘2’
services:
rocketchat:
image: rocketchat/rocket.chat:4.2.0
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=…
- MONGO_URL=…
- MONGO_OPLOG_URL=…
- MAIL_URL=…
- HTTP_PROXY=…
- HTTPS_PROXY=…
depends_on:
- mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: your.domain.tld"
mongo:
image: mongo:4.0
restart: unless-stopped
volumes:
- ./data/db:/data/db
#- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
labels:
- “traefik.enable=false”
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:
^C# - /var/run/docker.sock:/var/run/docker.sock.Certificates:‘https’ on port 3001, e.g. for hubot-jenkins-notifier