Docker Development Setup

Complete guide to setting up Chatwoot development environment using Docker and Docker Compose.

Docker Development Setup

This guide will help you set up a complete Chatwoot development environment using Docker and Docker Compose.

Pre-requisites

Before proceeding, make sure you have the latest version of docker and docker-compose installed.

As of now, we recommend a version equal to or higher than the following:

Install Docker

Windows

  1. Download Docker Desktop from https://www.docker.com/products/docker-desktop/
  2. Run the installer and follow setup instructions
  3. Enable WSL2 backend (recommended)
  4. Restart your computer when prompted

macOS

Linux (Ubuntu/Debian)

After adding yourself to the docker group on Linux, log out and log back in for the changes to take effect.

Development Environment

  1. Clone the repository.

  2. Make a copy of the example environment file and modify it as required.

  3. Build the images.

  4. After building the image or destroying the stack, you would have to reset the database using the following command.

  5. To run the app:

    • Access the rails app frontend by visiting http://0.0.0.0:3000/
    • Access Mailhog inbox by visiting http://0.0.0.0:8025/ (You will receive all emails going out of the application here)

    Login with credentials

  6. To stop the app:

Running RSpec Tests

For running the complete RSpec tests:

For running specific test:

Production Environment

To debug the production build locally, set SECRET_KEY_BASE environment variable in your .env file and then run the below commands:

Debugging Mode

To use debuggers like byebug or binding.pry, use the following command to bring up the app instead of docker compose up:

Development Workflow

Daily Development Commands

Troubleshooting

If there is an update to any of the following:

  • dockerfile
  • gemfile
  • package.json
  • schema change

Make sure to rebuild the containers and run db:reset.

Common Issues

Getting Help

If you encounter Docker-specific issues:


Your Docker development environment is now ready for Chatwoot development! 🐳

Built with

Show your support! Star us on GitHub ⭐️