---
# Based on https://hub.docker.com/r/fluent/fluentd/
#
# DOCKER_HOST=192.168.4.41:2376 docker-compose up -d
#
# docker login dkregistry.xai-corp.net:5000
# docker-compose build && docker push dkregistry.xai-corp.net:5000/fluentd:latest
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose-prod.yml services
# DOCKER_HOST=dkhost:2376 docker stack ps services

version: '3.4'
services:

  fluentd:
    image: "dkregistry.xai-corp.net:5000/fluentd:latest"
    volumes:
      - /opt/shared/logs:/fluentd/log
    ports:
      - "24224:24224"
      - "24224:24224/udp"
      - 24220:24220

    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: any
        delay: "1s"
        max_attempts: 3
      update_config:
        parallelism: 1
        delay: 2s
        order: start-first
      resources:
        limits:
          cpus: '1'
          memory: 128M
