services:
  app:
    image: registry.caldwell.digital/home/torsearch-app:${TAG}
    ports:
      - "${SWARM_PORT}:80"
    environment:
      MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
      MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
    deploy:
      replicas: 2
    volumes:
      - /mnt/media/downloads/movies:/var/download/movies
      - /mnt/media/downloads/tvshows:/var/download/tvshows
      - mercure_data:/data
      - mercure_config:/config


  worker:
    image: registry.caldwell.digital/home/torsearch-worker:${TAG}
    volumes:
      - /mnt/media/downloads/movies:/var/download/movies
      - /mnt/media/downloads/tvshows:/var/download/tvshows
    deploy:
      replicas: 2
    depends_on:
      - app


  scheduler:
    image: registry.caldwell.digital/home/torsearch-scheduler:${TAG}
    volumes:
      - /mnt/media/downloads/movies:/var/download/movies
      - /mnt/media/downloads/tvshows:/var/download/tvshows
    depends_on:
      - app


volumes:
  mercure_config:
  mercure_data:
