services:
db:
image: docker.io/bitnami/mongodb:7.0.15
container_name: rocketchat-db
hostname: rocketchat-db
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 10s
retries: 5
start_period: 20s
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: rs0
ALLOW_EMPTY_PASSWORD: 1
MONGODB_SYSTEM_LOG_VERBOSITY: 3
volumes:
- /volume1/docker/rocketchat/db:/bitnami/mongodb:rw
restart: on-failure:5
rocketchat:
image: rocketchat/rocket.chat:latest
container_name: rocketchat
hostname: rocketchat
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 3000 || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
security_opt:
- no-new-privileges:true
labels:
traefik.enable: true
traefik.http.routers.rocketchat.rule: Host(`rocketchat.datastore.center`)
traefik.http.routers.rocketchat.entrypoints: http
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme: https
traefik.http.routers.rocketchat.middlewares: redirect-to-https@docker
traefik.http.routers.rocketchat-secured.rule: Host(`rocketchat.datastore.center`)
traefik.http.routers.rocketchat-secured.entrypoints: https
traefik.http.routers.rocketchat-secured.tls: true
traefik.http.routers.rocketchat-secured.tls.certresolver: le
environment:
MONGO_URL: mongodb://rocketchat-db:27017/rocketchat?replicaSet=rs0
MONGO_OPLOG_URL: mongodb://rocketchat-db:27017/local?replicaSet=rs0
ROOT_URL: https://rocketchat.datastore.center
URL: https://rocketchat.datastore.center
PORT: 3000
DEPLOY_METHOD: docker
volumes:
- /volume1/docker/rocketchat/data:/app/uploads:rw
ports:
- 3000:3000
restart: on-failure:5
depends_on:
db:
condition: service_started
traefik:
image: docker.io/traefik:latest
hostname: rocketchat-web
container_name: rocketchat-web
restart: always
command:
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --certificatesresolvers.le.acme.tlschallenge=true
- --certificatesresolvers.le.acme.email=spiridonov.konstantin@gmail.com
- --certificatesresolvers.le.acme.storage=/letsencrypt/acme.json
# This line below is to get a testing SSL cert, just uncomment it and thats it.
#- --certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- ./letsencrypt:/letsencrypt:rw
- /var/run/docker.sock:/var/run/docker.sock:ro