---
# docker-compose file for memcached
# DOCKER_HOST=dkhost:2376 docker-compose up -d
# DOCKER_HOST=dkhost:2376 docker stack deploy -c docker-compose.yml services
# DOCKER_HOST=dkhost:2376 docker service ps services_memcached

version: '3.4'
services:

  memcached:
    image: "memcached:alpine"
    ports:
      - "11211:11211"
    command:
      - memcached
      - -m64

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

    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: '0.5'
          memory: 65M

    networks:
      - prod_cache
