Note: Jellyfin is clearly using some of Emby code as I saw emby in the logs and my first attempt failed because I'm migrating from Emby, have Emby running and they both use port 8096. For starting, I'll define a portmap and if I leave emby I'll perhaps switch jellyfin to network mode host for DLNA support.

https://jellyfin.org/docs/general/administration/installing.html

WD=/opt/jellyfin
mkdir -p $WD/{setup,conf,cache}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 jellyfin:
    container_name: jellyfin
    image: jellyfin/jellyfin
    hostname: jellyfin
#    network_mode: host
    ports:
      - '8394:80'
    volumes:
      - type: bind
        source: /opt/jellyfin/conf/
        target: /config
      - type: bind
        source: /opt/jellyfin/cache/
        target: /cache
    environment:
      - 'TZ=${TZ}'
      - 'JELLYFIN_PublishedServerUrl=${JELLYFIN_PublishedServerUrl}'

EOF
chmod +x docker-compose.yaml
cd $WD/setup
cat << 'EOF'>.env
TZ=America/Whitehorse
JELLYFIN_PublishedServerUrl=
EOF
chmod +x .env
WD=/opt/jellyfin/setup
cat << EOF >$WD/jellyfin.service.setup.sh
cat << EOL >/lib/systemd/system/jellyfin.service
[Unit]
Description=jellyfin_Docker
Requires=docker.service network-online.target

[Service]

Restart=on-abnormal
ExecStart=/usr/bin/docker-compose --project-name jellyfin --project-directory $WD -f $WD/docker-compose.yaml up
ExecStop=/usr/bin/docker-compose --project-name jellyfin --project-directory $WD -f $WD/docker-compose.yaml stop

[Install]
WantedBy=multi-user.target
EOL
systemctl enable jellyfin
systemctl restart jellyfin
systemctl status jellyfin
EOF
chmod +x $WD/jellyfin.service.setup.sh
$WD/jellyfin.service.setup.sh
echo 'alias jfincli="docker exec -it jellyfin /bin/bash"' >> ~/.bashrc
source ~/.bashrc