Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
/ cabrita Public archive

TUI dashboard for easy visualization of docker services

Notifications You must be signed in to change notification settings

chrismaille/cabrita

Repository files navigation

Welcome to Cabrita's documentation!

PyPI PyPI - Python Version Documentation Status Codacy Badge Maintainability Code style: black pre-commit

Cabrita is a Terminal Dashboard for docker services. You can easily follow the status for your docker containers:

  • Which services are running
  • The ports used by each one
  • The number of instances
  • The git status for the source code inside them
  • The container healthcheck status, if available

Install

$ pip install cabrita

Usage

Usage is very simple: just change directory where's your docker-compose.yml is located and run:

$ cd /path/to/your/docker_compose
$ cab # or cabrita

asciicast

You can also pass the full path for the docker-compose.yml files on command line:

$ cab /path/to/docker-compose-file /path/to/docker-compose-override

Customize Dashboard

To customize cabrita you can create a yaml file, to create and configure boxes. You can select which docker containers will show in each box and what info these boxes will show for each service inside them.

For example, copy and paste this yaml and save the cabrita.yml in the same directory where your docker-compose.yml is located:

version: 2
title: My Docker Project
background_color: grey # options: black, blue, cyan, grey, yellow, white
compose_files:
  - ./docker-compose.yml
boxes:
  main_box:
    main: true
    name: My Services
    port_view: status # options: column, name, status
    port_detail: internal # options: internal, external or both
    show_revision: true # will show commit hash and git tag if available
    watch_branch: origin/staging # check how ahead or behind you are regard this branch
  django:
    name: Django Apps
    show_git: false
    includes:  # this box will show only services named in includes and categories options
      - django
    categories: # for each included service, add column for each category below
      - worker
      - redis
watchers:
  ping:  # ping watchers are using to ping informed address each n seconds.
    google:
      name: Check internet connectivity
      address: https://www.google.com
      message_on_success: UP
      message_on_error: DOWN

Let's use our docker project located in /sheep folder. To start cabrita with the new setup you can type:

# Start docker project services first
$ cd path/to/sheep
$ TEST_PROJECT_PATH=$(pwd) docker-compose up -d

# Then, you can call directy the app passing the yaml path:
$ cab --path cabrita.yml

# Or you can use the CABRITA_PATH environment variable:
$ export CABRITA_PATH=/path/to/cabrita.yml
$ cab

Your Dashboard will show like this:

Image

More Info

  • For more advanced customization, please check the tutorial
  • For the complete list of cabrita options, please check the Cabrita File Reference