version: '3.9'

services:
  jellyfin:
    image: jellyfin/jellyfin:10.9.10
    environment:
      - JELLYFIN_PublishedServerUrl=jellyfin.localhost
    volumes:
      - jellyfin_config:/config
      - jellyfin_cache:/cache
      - media_movies:/media/movies:ro
      - media_tv:/media/tv:ro
    networks:
      - traefik-public
    deploy:
      resources:
        reservations:
          devices:
          - capabilities: [gpu]
            device_ids: ["0"]
      labels:
        - traefik.enable=true
        - traefik.http.routers.jellyfin.rule=Host(`jellyfin.localhost`)
        - traefik.http.routers.jellyfin.entrypoints=websecure
        - traefik.http.routers.jellyfin.tls=true
        - traefik.http.services.jellyfin.loadbalancer.server.port=8096

volumes:
  jellyfin_config:
    driver: local
    driver_opts:
      type: nfs
      o: addr=omv800.local,nolock,soft,rw
      device: :/export/jellyfin/config
  jellyfin_cache:
    driver: local
  media_movies:
    driver: local
    driver_opts:
      type: nfs
      o: addr=omv800.local,nolock,soft,ro
      device: :/export/media/movies
  media_tv:
    driver: local
    driver_opts:
      type: nfs
      o: addr=omv800.local,nolock,soft,ro
      device: :/export/media/tv

networks:
  traefik-public:
    external: true
