Skip to main content

XBot Cloud - Local Development Setup

This guide helps you set up the XBot Cloud development environment locally using Docker and Docker Compose.

Prerequisites

  • Ubuntu-based Linux system
  • Git access to the XBot Cloud repository
  • Basic familiarity with Docker and Docker Compose

Docker Installation

First, ensure you have the correct Docker version installed:

# Stop Docker service if already running
sudo systemctl stop docker

# Remove any existing Docker packages
sudo apt-get remove docker-ce docker-ce-cli containerd.io

# Install Docker version 20.10.8
sudo apt-get update
sudo apt-get install -y \
docker-ce=5:20.10.8~3-0~ubuntu-$(lsb_release -cs) \
docker-ce-cli=5:20.10.8~3-0~ubuntu-$(lsb_release -cs) \
containerd.io

# Start Docker service
sudo systemctl start docker

# Verify Docker version
docker --version

Enable Docker Experimental Features

Add the following lines to your ~/.bashrc:

export DOCKER_BUILDKIT=1  
export DOCKER_CLI_EXPERIMENTAL=enabled
export COMPOSE_DOCKER_CLI_BUILD=1

Then reload your shell:

source ~/.bashrc

Install Buildx:

docker buildx install

Setting Up XBot Cloud

Clone the Repository

git clone git@gitlab.com:signalx/xbot/xbot-cloud.git  
cd xbot-cloud

Development Configuration

Create a symbolic link for the development override file:

ln -s docker-compose.override.dev.yml docker-compose.override.yml

Initial Setup

Start only the nginx container first:

sudo docker-compose stop nginx
sudo docker-compose rm -v nginx
cd deploy/nginx/
sudo docker build -f Dockerfile-Local .
cd ../../ sudo docker-compose up -d nginx 

Note: If nginx is in restarting state post these steps, try restarting the nginx and core containers:

sudo docker-compose restart nginx core 

Verify it's running:

docker-compose ps

Start All Services

Launch all required containers:

docker-compose up -d

Verify Running Containers

Ensure these containers are running:

  • nginx
  • cm-dashboard
  • frontend
  • core
  • crawlers
  • db
  • hc_api_litigation

Database Setup

Once the core container is running, create a local superuser:

docker-compose exec db bash
psql -U xbot -d xbotdb
CREATE EXTENSION IF NOT EXISTS pg_trgm;
docker-compose exec core bash
cd WEBAPP
python manage.py migrate
python manage.py createsuperuser

Follow the prompts to create your admin credentials.

Accessing the Application

After completing setup, access the Django Admin Panel at:

http://localhost:8000/xbot-admin

Use your newly created superuser credentials to log in.

Troubleshooting

If you encounter issues:

  1. Check container logs: docker-compose logs <container-name>
  2. Ensure all required containers are running: docker-compose ps
  3. Verify network connectivity between containers

Development Workflow

  • Make changes to the codebase on your local machine
  • Docker volumes will sync changes to the containers
  • Restart specific services as needed: docker-compose restart <service-name>

Additional Resources

Support

For questions or issues, contact the XBot Cloud development team.