55 lines
2.4 KiB
YAML
55 lines
2.4 KiB
YAML
name: audiobookshelf
|
|
|
|
networks:
|
|
traefik-net:
|
|
external: true
|
|
|
|
services:
|
|
audiobookshelf:
|
|
image: ghcr.io/advplyr/audiobookshelf:latest
|
|
env_file: .audiobookshelf.env
|
|
hostname: audiobookshelf
|
|
group_add:
|
|
- "${PGID}"
|
|
networks:
|
|
- traefik-net
|
|
volumes:
|
|
- "${DATADIR}/config:/config"
|
|
- "${DATADIR}/appdata:/metadata"
|
|
- "${MEDIADIR}/Books/audiobooks:/audiobooks"
|
|
- "${MEDIADIR}/Podcasts:/podcasts"
|
|
restart: unless-stopped
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=traefik-net"
|
|
#
|
|
# http services
|
|
# -------------
|
|
- "traefik.http.services.${APPLICATION_NAME}-svc.loadbalancer.server.port=${WEBUI_PORT}"
|
|
#
|
|
# http routers
|
|
# ------------
|
|
# limit router to web ":80" entrypoint (Note: web entrypoint http requests are globally redirected to websecure router in traefik.yml)
|
|
- "traefik.http.routers.${APPLICATION_NAME}-rtr.entrypoints=web"
|
|
# set match criteria for router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-rtr.rule=Host(`${APPLICATION_NAME}.${DOMAINNAME}`)&& PathPrefix(`/`)"
|
|
# attach middlewares to router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-rtr.middlewares=middlewares-https-redirectScheme@file"
|
|
# assign svc target to router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-rtr.service=${APPLICATION_NAME}-svc"
|
|
#
|
|
# limit router to websecure ":443" entrypoint
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.entrypoints=websecure"
|
|
# set match criteria for router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.rule=Host(`${APPLICATION_NAME}.${DOMAINNAME}`)&& PathPrefix(`/`)"
|
|
# attach middlewares to router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.middlewares=chain-no-auth@file"
|
|
# set router to be dedicated to secure requests only for the host specified in match criteria
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls=true"
|
|
# apply tls options
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.options=tls-opts@file"
|
|
# generate certificates using certresolver specified
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.certresolver=solver-dns"
|
|
# assign svc target to router
|
|
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.service=${APPLICATION_NAME}-svc"
|