version: '3.8'
services:

  workflow:
    image: marconi.aoc.nrao.edu/workspaces/workflow:${TAG_TO_DEPLOY}
    ports:
      - "3456:3456"
    volumes:
      - /home/ssa/capo/:/root/.capo
    deploy:
      placement:
        constraints:
          - "node.labels.node_env==${SWARM_NODE_ENV}"
      restart_policy:
        condition: on-failure
        max_attempts: 3
        window: 5s
      update_config:
        parallelism: 2
        delay: 5s
        order: stop-first
        failure_action: rollback
      rollback_config:
        parallelism: 0
        order: stop-first


  capability:
    image: marconi.aoc.nrao.edu/workspaces/capability:${TAG_TO_DEPLOY}
    ports:
      - "3457:3457"
    volumes:
      - /home/ssa/capo/:/root/.capo
    deploy:
      placement:
        constraints:
          - "node.labels.node_env==${SWARM_NODE_ENV}"
      restart_policy:
        condition: on-failure
        max_attempts: 3
        window: 5s
      update_config:
        parallelism: 2
        delay: 5s
        order: stop-first
        failure_action: rollback
      rollback_config:
        parallelism: 0
        order: stop-first


# schema:
  #   image: marconi.aoc.nrao.edu/ops/base:workspaces
  #   depends_on:
  #     - db
  #   volumes:
  #     - ./schema:/code/schema