Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # place this file in it's own folder and in that folder execute 'docker compose up -d' without the quotes as root to set up everything. You can tear it all down (stop and delete the containers) with 'docker compose down'
- volumes:
- jellyfin:
- caddy-data:
- caddy-config:
- caddy-logs:
- # run 'docker create network internal; docker create network web' (without the quotes) before executing this or it will complain that the networks don't exist!
- networks:
- web:
- external: true
- internal:
- external: true
- services:
- caddy:
- image: homeall/caddy-reverse-proxy-cloudflare:latest
- container_name: caddy
- ports:
- - your.servers.LAN.ip:80:80
- - your.servers.LAN.ip:443:443
- environment:
- - TZ=America/New_York #change to your timezone
- - CLOUDFLARE_EMAIL=Your_Cloudflare_Account_Name
- - CLOUDFLARE_API_TOKEN=Your_API_Token
- - ACME_TRUE=true
- labels:
- caddy.log.format: console
- caddy.log.output: stdout
- caddy.log.level: info
- #caddy.acme_ca: https://acme-staging-v02.api.letsencrypt.org/directory #uncomment for testing, it won't generate a valid SSL cert but it will let you know that everything is working correctly (it acts like it's attempting to generate a valid cert), if you don't use the 'staging' environment while testing it will rate limit you after a certain amount of attempts and block you for like 24-48 hours, invalidating your tests and make you bash your head against the wall while trying to figure out why it won't work correctly
- #if it refuses to issue certs stating that it can't find the zone for your domain. make sure /etc/resolv.conf is set to 1.1.1.1 (or your authoritative DNS server)
- networks:
- - web
- restart: always
- cap_add:
- - NET_ADMIN
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock
- - caddy-data:/data/caddy
- - caddy-config:/config/caddy
- - caddy-logs:/logs
- jellyfin:
- image: jellyfin/jellyfin
- container_name: jellyfin
- user: 1000:1000 (this is probably a different UID for you, check your UID with the 'id <username>' CLI command replacing <username> with your username
- networks:
- - internal
- - web
- ports:
- - your.servers.lan.ip:8096:8096
- labels:
- caddy: jellyfin.yourdomain.com
- caddy.reverse_proxy: your.servers.LAN.ip:8096
- caddy.tls.dns: cloudflare Paste_Your_API_Key_here #don't delete the word cloudflare!
- caddy.log.output: file /logs/jellyfin.log
- caddy.log.level: info #debug can also be useful
- volumes:
- - jellyfin:/config
- - /path/to/media/on/your/server:/media
- restart: always
- environment:
- - JELLYFIN_PublishedServerUrl=https://jellyfin.yourdomain.com
- - HEALTHCHECK_URL=http://your.servers.LAN.ip:8096/health
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement