# This is an example configuration for Docker Compose. Make sure to atleast update
# the cookie secret & postgres database password.
#
# Some other recommendations:
# 1. To persist Postgres data, assign it a volume host location.
# 2. Split the worker service to adhoc workers and scheduled queries workers.
version: '2'
services:
  logiqs3-minio:
    image: minio/minio
    environment:
      MINIO_ACCESS_KEY: logiq_access
      MINIO_SECRET_KEY: logiq_secret
    command: server /data
    ports:
      - "9000:9000"
    restart: always
  logiq-ready:
    image: logiqai/quickstart:ready.1.2.1
    command: ["/ready_init_container.sh", "python","/send_ready_message.py"]
    restart: "no"
    depends_on:
      - logiq-flash
  createbucket:
    image: minio/mc
    restart: "no"
    depends_on:
      - logiqs3-minio
    entrypoint: >
      /bin/sh -c "
      sleep 10;
      /usr/bin/mc config host add logiq http://logiqs3-minio:9000 logiq_access logiq_secret;
      /usr/bin/mc mb logiq/logiq;
      exit 0;
      "	
  logiq-flash:
    image: logiqai/quickstart:flash.singlecontainer.1.2.1
    command: [ "/flash_init_container.sh", "sh", "-c", "/start_logiq.sh" ]
    depends_on:
      - logiqs3-minio
    environment:
      REDIS_HOST: localhost
      REDIS_PORT: 6379
      POSTGRES_HOST: localhost
      POSTGRES_PORT: 5432
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      FLAGS_EXTRA: "-event_workers 5 -workers 20 -raft_snapshot_threshold 8192 -is-kube=false -timeout_inital_logs 2h"
    ports:
     - "7514:7514"
     - "514:514"
     - "2514:2514"
     - "20514:20514"
     - "4001:4001"
     - "4002:4002"
     - "8080:8080"
     - "8081:50054"
     - "9998:9998"
     - "9999:9999"
     - "24224:24224"
     - "24225:24225"  
    restart: always
    ulimits:
      nproc: 65535
      nofile:
       soft: 65535
       hard: 65535
