version: "3.6"
services:
  modules_configuration-dispatcher_main:
    image: osp-configuration-dispatcher:1.3.1
    networks:
      - "portainer"
      - "back"
    ports:
      - target: 5022
        published: 5022
        protocol: tcp
      - target: 9100
        published: 9102
        protocol: tcp
    volumes:
      - "osp-git:/git:rw"
      - "osp-runtime-configuration:/osp/run/config/:rw"
    configs:
      - source: osp-config-1
        target: /osp/config/portainer.json
        mode: 444
    environment:
      IMAGE_VERSION: 1.3.1
      IMAGE_REPO: ""
    healthcheck:
      test: ["CMD", "/osp/bin/dispatcher-healthcheck.sh"]
      interval: 5s
      timeout: 4s
      retries: 5
      start_period: 60s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "1"
    secrets:
      - source: osp-stack-1_admin-pwd
        target: admin-pwd

configs:
  osp-config-1:
    external: true

networks:
  portainer:
    external: true
    name: portainer_agent_network
  back:
    driver: overlay
    internal: true
  outside_access:
    driver: overlay
    internal: false
  front:
    driver: overlay
    internal: true

volumes:
  osp-git:
  osp-runtime-configuration:

secrets:
  osp-stack-1_admin-user:
    external: true
  osp-stack-1_admin-pwd:
    external: true
