C
Chabi
Self Hosting

Docker Compose

Run the published GHCR image with persistent storage and verify the instance over Redis and HTTP.

Compose File

This is the baseline self-hosting configuration for Chabi:

services:
  chabi:
    image: ghcr.io/envsync-cloud/chabi:latest
    ports:
      - "6379:6379"
      - "8080:8080"
    environment:
      BIND_HOST: 0.0.0.0
      REDIS_PORT: 6379
      HTTP_PORT: 8080
      SNAPSHOT_PATH: /data
      SNAPSHOT_INTERVAL_SECS: 60
    volumes:
      - ./data:/data
    restart: unless-stopped

Bring it up:

docker compose up -d

Why These Settings

  • BIND_HOST=0.0.0.0 lets the container listen on the published interfaces.
  • SNAPSHOT_PATH=/data points persistence at the mounted volume.
  • SNAPSHOT_INTERVAL_SECS=60 keeps the default background snapshot cadence explicit.
  • ./data:/data preserves chabi.kdb outside the container.

Verification

Verify the Redis protocol surface:

redis-cli -p 6379 PING

Verify the HTTP listener:

curl http://127.0.0.1:8080/
curl http://127.0.0.1:8080/metrics
curl http://127.0.0.1:8080/snapshot

Expected behaviors:

  • PING returns PONG
  • / returns {"status": "ok"}
  • /metrics returns Prometheus text such as chabi_connected_clients
  • /snapshot returns JSON keyed by database number

Notes

  • On startup, Chabi attempts to restore an existing chabi.kdb from SNAPSHOT_PATH.
  • SAVE triggers a synchronous snapshot write.
  • If you change published ports, keep the container-side ports at 6379 and 8080 unless you also change the environment variables.

On this page