x-env:
  &template
  image: fcb_photo_review:1.12.10
  restart: always

services:
  photo_review_1:
    <<: *template
    build:
      context: .
    container_name: photo_review_1
    hostname: photo_review_1
    volumes:
      - ./log:/app/log
      - ./model:/app/model
    command: [ "photo_review.py", "--clean", "True" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "0", "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

  photo_review_2:
    <<: *template
    container_name: photo_review_2
    hostname: photo_review_2
    volumes:
      - ./log:/app/log
      - ./model:/app/model
    depends_on:
      - photo_review_1
    command: [ "photo_review.py" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "0", "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

  photo_review_3:
    <<: *template
    container_name: photo_review_3
    hostname: photo_review_3
    volumes:
      - ./log:/app/log
      - ./model:/app/model
    depends_on:
      - photo_review_2
    command: [ "photo_review.py" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "0", "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

  photo_review_4:
    <<: *template
    container_name: photo_review_4
    hostname: photo_review_4
    volumes:
      - ./log:/app/log
      - ./model:/app/model
    depends_on:
      - photo_review_3
    command: [ "photo_review.py" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "0", "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

  photo_review_5:
    <<: *template
    container_name: photo_review_5
    hostname: photo_review_5
    volumes:
      - ./log:/app/log
      - ./model:/app/model
    depends_on:
      - photo_review_4
    command: [ "photo_review.py" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "0", "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

#  photo_review_6:
#    <<: *template
#    container_name: photo_review_6
#    hostname: photo_review_6
#    volumes:
#      - ./log:/app/log
#      - ./model:/app/model
#    depends_on:
#      - photo_review_5
#    command: [ "photo_review.py" ]
#    deploy:
#      resources:
#        reservations:
#          devices:
#            - device_ids: [ "0", "1" ]
#              capabilities: [ "gpu" ]
#              driver: "nvidia"

  photo_mask_1:
    <<: *template
    container_name: photo_mask_1
    hostname: photo_mask_1
    volumes:
      - ./log:/app/log
    depends_on:
      - photo_review_5
    command: [ "photo_mask.py", "--clean", "True" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

  photo_mask_2:
    <<: *template
    container_name: photo_mask_2
    hostname: photo_mask_2
    volumes:
      - ./log:/app/log
    depends_on:
      - photo_mask_1
    command: [ "photo_mask.py" ]
    deploy:
      resources:
        reservations:
          devices:
            - device_ids: [ "1" ]
              capabilities: [ "gpu" ]
              driver: "nvidia"

#  photo_mask_3:
#    <<: *template
#    container_name: photo_mask_3
#    hostname: photo_mask_3
#    volumes:
#      - ./log:/app/log
#    depends_on:
#      - photo_mask_2
#    command: [ "photo_mask.py" ]
#    deploy:
#      resources:
#        reservations:
#          devices:
#            - device_ids: [ "1" ]
#              capabilities: [ "gpu" ]
#              driver: "nvidia"