services:
  cloudbeaver:
    image: dbeaver/cloudbeaver:25.2.5
    container_name: rb-cloudbeaver
    volumes:
      - ./workspace:/opt/cloudbeaver/workspace
    environment:
      - CLOUDBEAVER_WORKSPACE=/opt/cloudbeaver/workspace
      - CLOUDBEAVER_EXPIRE_SESSION_AFTER_PERIOD=10800000
    ports:
      - "${HOST_PORT:-8978}:8978"
    restart: unless-stopped
    healthcheck:
      # Uses curl to check the API system info endpoint.
      # The '-f' flag makes curl return a non-zero exit code on HTTP errors (4xx or 5xx), which Docker interprets as "unhealthy".
      test: ["CMD-SHELL", "curl http://localhost:8978|| exit 1"]
      interval: 5s   
      timeout: 5s    
      retries: 30      
      start_period: 10s