---
# DOCKER_HOST=192.168.4.41:2376 docker-compose up -d
# DOCKER_HOST=dkmanager:2376 docker stack deploy -c docker-compose.yml dkui

version: '3.4'
services:
  app:
#    restart: always
#    privileged: true
    image: "portainer/portainer-ce:alpine"

    volumes:
#      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/shared/portainer/data:/data
    ports:
#       - "80:80"
      - "9000:9000"
    command:
      - "-H"
      - "tcp://dkmanager:2376"

    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: any
        delay: 30s
        max_attempts: 10
      update_config:
        parallelism: 1
        delay: 2s
        order: start-first
      labels:
        net.xai-corp.dkui.description: portainer ui for docker host and swarm management
      resources:
        limits:
#          cpus: '0.2'
          memory: 32M

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

    networks:
      - prod_ui

networks:
  prod_ui:
    external:
      name: prod_ui
  prod_db:
    external:
      name: prod_db
  prod_cache:
    external:
      name: prod_cache
