# Service composition file for Docker Compose or Podman Compose
# https://cratedb.com/docs/guide/integrate/influxdb/

services:

  cratedb:
    image: docker.io/crate:latest
    command: >
      crate -Cdiscovery.type=single-node
    ports:
      - "4200:4200/tcp"
      - "5432:5432/tcp"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:4200/"]
      interval: 5s
      timeout: 30s
      retries: 5

  influxdb:
    image: docker.io/influxdb:2
    ports:
      - "8086:8086/tcp"
    environment:
      DOCKER_INFLUXDB_INIT_MODE: setup
      DOCKER_INFLUXDB_INIT_USERNAME: admin
      DOCKER_INFLUXDB_INIT_PASSWORD: secret0000
      DOCKER_INFLUXDB_INIT_ORG: example
      DOCKER_INFLUXDB_INIT_BUCKET: testdrive
      DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: token

  cratedb-toolkit:
    image: ghcr.io/crate/cratedb-toolkit:latest
    profiles: ["cli"]
