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


  worker:
    image: registry.caldwell.digital/home/torsearch-worker:${TAG}
    volumes:
      - /mnt/media/downloads/movies:/var/download/movies
      - /mnt/media/downloads/tvshows:/var/download/tvshows
    restart: always
    command: -vv --time-limit=3600 --limit=10
    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
    restart: always
    command: -vv
    depends_on:
      - app


  redis:
    image: redis:latest
    volumes:
      - redis_data:/data
    command: redis-server --maxmemory 512MB
    restart: unless-stopped


volumes:
  mysql:
  mercure_config:
  mercure_data:
  redis_data:

