apt -y update apt -y install curl nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
准备项目目录,在目录内新建一个docker-compose.yml:
mkdir /opt/audiobookshelf && cd /opt/audiobookshelf && nano docker-compose.yml
写入如下配置:
version: '3.5' services: audiobookshelf: image: ghcr.io/advplyr/audiobookshelf:latest container_name: audiobookshelf restart: unless-stopped ports: - 127.0.0.1:13378:80 volumes: - ./audiobooks:/audiobooks - ./podcasts:/podcasts - ./config:/config - ./metadata:/metadata
启动:
docker-compose up -d
现在配置反向代理,新建一个nginx配置文件:
nano /etc/nginx/conf.d/audiobook.conf
写入如下配置:
server { listen 80; server_name audiobook.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:13378; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
签发ssl证书:
certbot --nginx
打开域名第一次访问需要创建一个管理员账号:
之后添加库,把之前映射到容器内的目录添加上去,audiobooks目录用于有声读物:
podcasts目录用于播客:
这里简单介绍一下播客的用法,你可以直接在这个页面搜索资源:
添加:
添加到库里面之后点这个查找按钮:
选择要下载的剧集:
下载好的剧集就可以播放了: