# Запуск готового образа с Docker Hub без .env и без сборки (только Docker).
# Образ по умолчанию: inecs/kind-cluster-dashboard:v1.0.0 (см. Makefile RELEASE_TAG / DOCKERHUB_REPO).
# Создайте каталог: mkdir -p clusters
# Запуск: docker compose -f compose/docker-compose.hub.docker.yml up -d
#
# Автор: Сергей Антропов — https://devops.org.ru

services:
  kind-k8s-web:
    image: ${KIND_K8S_HUB_IMAGE:-inecs/kind-cluster-dashboard:v1.0.0}
    container_name: kind-clusters-dashboard
    user: "0:0"
    volumes:
      - ${KIND_K8S_CLUSTERS_DIR:-./clusters}:/work/clusters
      - ${CONTAINER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
    ports:
      - "8080:6000"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      # Значения как у дефолтов в docker-compose.yml и в коде приложения (без пустых строк).
      HOME: /root
      DOCKER_HOST: unix:///var/run/docker.sock
      KIND_K8S_IN_CONTAINER: "1"
      KIND_K8S_WORKDIR: /work
      KIND_K8S_PATCH_KUBECONFIG: "1"
      KIND_K8S_KUBECONFIG_CLIENT_HOST: localhost
      KIND_K8S_KUBECONFIG_TLS_SERVER_NAME: localhost
      KIND_K8S_APISERVER_GATEWAY_HOST: host.docker.internal
      CONTAINER_CLI: docker
      KIND_K8S_SKIP_VERSION_LIST: "0"
      KIND_K8S_VERSION_LIST_DISPLAY: "50"
      KIND_K8S_HUB_TAGS_MAX_PAGES: "120"
      KIND_K8S_DEBUG: "0"
      KIND_K8S_JOB_LOG_MAX_LINES: "2500"
      KIND_K8S_STREAM_PTY: "1"
      KIND_K8S_DOCKER_PULL_PLAIN: "1"
      KIND_K8S_JOB_API_LOG_MAX_LINES: "5000"
      KIND_K8S_JOBS_JSON: /work/clusters/kind_k8s_jobs.json
      KIND_K8S_README_PATH: /opt/kind-k8s/README.md
      KIND_K8S_WAIT_NODES: "1"
      KIND_K8S_WAIT_NODES_TIMEOUT_SEC: "300"
      KIND_K8S_HELM_TIMEOUT_SEC: "900"
      KIND_K8S_HELM_VERSIONS_CACHE_SEC: "600"
      KIND_K8S_HELM_VERSIONS_MAX: "80"
      KIND_K8S_CLUSTER_JOURNAL_MAX_ENTRIES: "500"
      KIND_K8S_CLUSTER_JOURNAL_MAX_LOG_LINES: "2000"
      KIND_K8S_HELM_ADDON_LOG_MAX_ENTRIES: "500"
      KIND_K8S_APP_TITLE: "Kind Clusters Dashboard"
      KIND_K8S_UVICORN_RELOAD: "0"
    working_dir: /opt/kind-k8s/app
    command: ["/opt/kind-k8s/run_uvicorn.sh"]
