version: "3.9"

services:
  tigerbeetle:
    image: ghcr.io/tigerbeetle/tigerbeetle:latest
    container_name: tigerbeetle
    command: >
      sh -c "
      if [ ! -f /data/0_0.tigerbeetle ]; then
        tigerbeetle init --cluster=0 --replica=0 --replica-count=1 /data/0_0.tigerbeetle;
      fi &&
      tigerbeetle start --addresses=0.0.0.0:3000 --cluster=0 --replica=0 /data/0_0.tigerbeetle
      "
    ports:
      - "3005:3000"
    volumes:
      - ./data:/data
    restart: unless-stopped

volumes: {}
