services:
  cloudbeaver:
    image: dbeaver/cloudbeaver:25.2.5
    restart: unless-stopped
    networks:
      cloudbeaver_runtipi_network:
        gw_priority: 0
      tipi_main_network:
        gw_priority: 1
    extra_hosts:
      - host.docker.internal:host-gateway
    environment:
      CB_SERVER_NAME: CloudBeaver
      CB_ADMIN_NAME: admin
      CB_ADMIN_PASSWORD: admin
    ports:
      - ${APP_PORT}:8978
    volumes:
      - ${APP_DATA_DIR}/data:/opt/cloudbeaver/workspace
    labels:
      generated: true
      traefik.enable: true
      traefik.docker.network: runtipi_tipi_main_network
      traefik.http.middlewares.cloudbeaver-runtipi-web-redirect.redirectscheme.scheme: https
      traefik.http.services.cloudbeaver-runtipi.loadbalancer.server.port: "8978"
      traefik.http.routers.cloudbeaver-runtipi-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.cloudbeaver-runtipi-insecure.entrypoints: web
      traefik.http.routers.cloudbeaver-runtipi-insecure.service: cloudbeaver-runtipi
      traefik.http.routers.cloudbeaver-runtipi-insecure.middlewares: cloudbeaver-runtipi-web-redirect
      traefik.http.routers.cloudbeaver-runtipi.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.cloudbeaver-runtipi.entrypoints: websecure
      traefik.http.routers.cloudbeaver-runtipi.service: cloudbeaver-runtipi
      traefik.http.routers.cloudbeaver-runtipi.tls.certresolver: myresolver
      runtipi.managed: true
      runtipi.appurn: cloudbeaver:runtipi
networks:
  tipi_main_network:
    name: runtipi_tipi_main_network
    external: true
  cloudbeaver_runtipi_network:
    name: cloudbeaver_runtipi_network
    external: false
    ipam:
      config:
        - subnet: 10.128.18.0/24

