Setup letschat with docker containers

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

Having chat rooms for specific topics or projects have become quite popular. IMHO it is a nice addon for development and deployment lifecycle management. HipChat or Slack are some popular providers. If you want to have an internal chat system, letschat is a quick way to accomplish that. It has some flaws, debugging LDAP was a horror, but basically is good enough in its vanilla state. Take as it is and its free (MIT License). We use it currently for receiving notifications from our continuous integration system.

Persistent data

letschat uses as data storage MongoDB. Start MongoDB as a docker container with a data volume for persistent storage.

docker run --name chat-mongo -v /var/opt/mongodb/data:/data/db -d mongo:latest

MongoDB is not clustered or high available. This is a simple setup.

Docker Customizations

Upload directory

mkdir -p /var/opt/letschat/uploads

Config directory

mkdir -p /opt/letschat/config

Place the content of this settings.yml in the created directory.

env: production

  enable: true
  host: 'localhost'
  port: 5000

  enable: true
  provider: local
    dir: uploads

  enable: false
  port: 5222
  domain: example.com

  uri: mongodb://localhost/letschat

  cookie: secretsauce

  providers: [local]

Start Letschat

We map the volumes and link with the MongoDB container, so letschat can use it for data persistence.

docker run  \
  --name letschat \
  --link chat-mongo:mongo \
  -p 8091:8080 -p 5222:5222 \
  -v /opt/letschat/config:/usr/src/app/config \
  -v /var/opt/letschat/uploads:/usr/src/app/uploads \
  --restart=always \
  -d sdelements/lets-chat
Please remember the terms for blog comments.