Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

5.2 KB
Raw Blame
# To find out does Loki work properly:
# - http://127.0.0.1:3100/ready
# - http://127.0.0.1:3100/metrics
#
# = Grafana configuration
# Default grafana user and password are "admin".
# Need to add data source: http://loki:3100
#

version: "3"

volumes:
  cargo_cache:
  pg_data:
  cargo_build_cache:
  ckh_data:

networks:
  ckh_net:

services:
  promtail:
    image: grafana/promtail:latest
    volumes:
      - ../logs:/var/log/router
      - ./config:/etc/promtail
      - /var/run/docker.sock:/var/run/docker.sock
    command: -config.file=/etc/promtail/promtail.yaml
    networks:
      - ckh_net
    restart: unless-stopped

  loki:
    image: grafana/loki:latest
    ports:
      - "3100"
    command: -config.file=/etc/loki/loki.yaml
    networks:
      - ckh_net
    restart: unless-stopped
    volumes:
      - ../config:/etc/loki

  otel-collector:
    image: lsampras/otelcontribcol:promtail-receiver
    command: --config=/etc/otel-collector.yaml
    networks:
      - ckh_net
    depends_on:
      - kafka0
    volumes:
      - ./config:/etc
      - /var/run/docker.sock:/var/run/docker.sock
      - ./otel.tmp:/tmp
    ports:
      - "4317"
      - "8888"
      - "3101"
      - "8889"
      - "24224"
    restart: unless-stopped

  prometheus:
    image: prom/prometheus:latest
    networks:
      - ckh_net
    volumes:
      - ../config/prometheus.yaml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"
    restart: unless-stopped

  tempo:
    image: grafana/tempo:latest
    command: -config.file=/etc/tempo.yaml
    volumes:
      - ../config/tempo.yaml:/etc/tempo.yaml
      - ./tempo.tmp:/tmp/tempo
    networks:
      - ckh_net
    ports:
      - "3200" # tempo
      - "4317" # otlp grpc
      - "4318" # otlp http
    restart: unless-stopped

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    networks:
      - ckh_net
    restart: unless-stopped
    volumes:
      - ../config:/etc/grafana

  kafka0:
    image: confluentinc/cp-kafka:7.0.5.arm64
    hostname: kafka0
    container_name: kafka0
    networks:
      - ckh_net
    ports:
      - 9092
      - 9093
      - 9997
      - "29092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka0:29092,PLAINTEXT_HOST://localhost:9092
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_PROCESS_ROLES: 'broker,controller'
      KAFKA_NODE_ID: 1
      KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka0:29093'
      KAFKA_LISTENERS: 'PLAINTEXT://kafka0:29092,CONTROLLER://kafka0:29093,PLAINTEXT_HOST://0.0.0.0:9092'
      KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
      KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
      JMX_PORT: 9997
      KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9997
    volumes:
      - ./kafka-script.sh:/tmp/update_run.sh
    command: "bash -c 'if [ ! -f /tmp/update_run.sh ]; then echo \"ERROR: Did you forget the update_run.sh file that came with this docker-compose.yml file?\" && exit 1 ; else /tmp/update_run.sh && /etc/confluent/docker/run ; fi'"

  # Kafka UI for debugging kafka queues
  kafka-ui:
    container_name: kafka-ui
    image: provectuslabs/kafka-ui:latest
    ports:
      - 8090:8080
    networks:
      - ckh_net
    depends_on:
      - kafka0
    environment:
      KAFKA_CLUSTERS_0_NAME: local
      KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka0:29092
      KAFKA_CLUSTERS_0_JMXPORT: 9997

  clickhouse-server:
    image: clickhouse/clickhouse-server:latest
    networks:
      - ckh_net
    ports:
      - "9000"
      - "8123:8123"
    volumes:
      - ckh_data:/var/lib/clickhouse
    ulimits:
      nofile:
        soft: 262144
        hard: 262144

  hyperswitch-server:
    image: rust:latest
    command: cargo run -- -f ./config/docker_compose.toml
    working_dir: /app
    ports:
      - "8080:8080"
    networks:
      - ckh_net
    volumes:
      - ../:/app
      - cargo_cache:/cargo_cache
      - cargo_build_cache:/cargo_build_cache
    environment:
      - CARGO_TARGET_DIR=/cargo_build_cache
      - OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector:4317
    labels:
      logs: "promtail"
    depends_on:
      - otel-collector
    healthcheck:
      test: curl --fail http://localhost:8080/health || exit 1
      interval: 60s
      retries: 3
      start_period: 20s
      timeout: 10s

  pg:
    image: postgres:14.5
    ports:
      - "5432"
    networks:
      - ckh_net
    volumes:
      - pg_data:/VAR/LIB/POSTGRESQL/DATA
    environment:
      - POSTGRES_USER=db_user
      - POSTGRES_PASSWORD=db_pass
      - POSTGRES_DB=hyperswitch_db

  redis-queue:
    image: redis:7
    command: redis-server /usr/local/etc/redis/redis.conf
    volumes:
      - ../config/redis.conf:/usr/local/etc/redis/redis.conf
    labels:
      - redis
    networks:
      - ckh_net
    ports:
      - "6379"