services:
  influxdb:
    image: influxdb:2.7-alpine
    ports:
      - 127.0.0.1:8086:8086
    env_file:
      - .env
    healthcheck:
      test: "curl -f http://localhost:8086/ping"
      interval: 5s
      timeout: 10s
      retries: 5
  rabbitmq:
    build:
      context: .
      target: rabbitmq
    ports:
      - 127.0.0.1:15672:15672

  rest:
    build:
      context: .
      target: rest
    depends_on:
      influxdb:
        condition: service_healthy
    env_file:
      - .env
  gateway:
    build:
      context: .
      target: gateway
    depends_on:
      rest:
        condition: service_started
      rabbitmq:
        condition: service_healthy
    env_file:
      - .env
  bot:
    build:
      context: .
      target: bot
    depends_on:
      rest:
        condition: service_started
      rabbitmq:
        condition: service_healthy
    env_file:
      - .env
