---
# docker-compose file for graylog
# DOCKER_HOST=dkhost03:2376 docker-compose up -d
# DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml graylog

version: '3'
services:

  graylog:
    image: graylog2/server:latest
    volumes:
      - /opt/shared/graylog/data/journal:/usr/share/graylog/data/journal
      - /opt/shared/graylog/config:/usr/share/graylog/data/config
    environment:
      GRAYLOG_PASSWORD_SECRET: gsahu1dj901hdaiuafg3g1q
      GRAYLOG_ROOT_PASSWORD_SHA2: d0fc133359968fbc38a267f29606c9dc805af7bcc231df9b9acd2e8e6e894ede
      GRAYLOG_WEB_ENDPOINT_URI: https://logs.xai-corp.net/api/
      GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/
      GRAYLOG_MONGODB_URI: mongodb://mongo/graylog
      GRAYLOG_ELASTICSEARCH_CLUSTER_NAME: es.xai-corp.net
    depends_on:
      - mongo
      - elasticsearch
    ports:
      - "10090:9000"
      - "12201:12201/udp"
      - "1514:1514/udp"
      - "514:514/udp"

#    logging:
#      driver: gelf
#      options:
#        gelf-address: "udp://logs.xai-corp.net:12201"

    deploy:
      mode: replicated
      replicas: 2
      restart_policy:
        condition: none
        delay: "1s"
        max_attempts: 3
      resources:
        limits:
          cpus: '1'
          memory: 1G

networks:
  default:
    external:
      name: prod
