---
# docker-compose file for cron
# docker login dkregistry.xai-corp.net:5000
# docker-compose build && docker push dkregistry.xai-corp.net:5000/cron:latest
# DOCKER_HOST=dkhost:2376 docker stack deploy -c docker-compose.yml services

# DOCKER_HOST=dkhost:2376 docker-compose up -d
# DOCKER_HOST=dkhost:2376 docker-compose exec -it cron_cron_1 /bin/sh


version: '3.4'
services:

  cron:
    image: "dkregistry.xai-corp.net:5000/xaicorp/cron:latest"
    build:
      context: ""
      dockerfile: Dockerfile

#    volumes:
#    - /var/run/docker.sock:/var/run/docker.sock

    deploy:
      mode: replicated

      replicas: 1
      restart_policy:
        condition: any
        delay: "1s"
        max_attempts: 3
      resources:
        limits:
          cpus: '1'
          memory: 8M

    logging:
      driver: fluentd
      options:
        fluentd-address: "logs.xai-corp.net:24224"
        fluentd-async-connect: 'true'
        tag: cron

    networks:
      - prod_app

#networks:
#  default:
#    external:
#      name: prod
