services:
  # Jellyfin
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    profiles:
      - jellyfin
    restart: on-failure:7
    environment:
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - TZ=${TZ:-Europe/Paris}
    depends_on:
      - caddy
    env_file:
      - ./env/jellyfin.env
    volumes:
      - jellyfin_config:/config
      - jellyfin_cache:/cache
      - public_data:/public
      - private_data:/private
    # Hardware acceleration (For Intel and AMD GPUs)
    devices:
      - /dev/dri:/dev/dri
    networks:
      - caddy-media
    security_opt:
      - no-new-privileges:true

volumes:
  jellyfin_config:
    name: jellyfin_config
  jellyfin_cache:
    name: jellyfin_cache
  public_data:
    name: public_data
  private_data:
    name: private_data

networks:
  caddy-media:
    driver: bridge
    name: caddy-media
