Koel Music Docker+宝塔+GoogleDrive无限云盘

参考官网 https://docs.koel.dev/#introduction

主要的Docker网站

宝塔+CloudFlare新建网站+SSL+强制https

在Google Drive上创建文件目录

假设已经网盘已经加载到 /data/gd_stanford

cd /data/gd_stanford/_host/bwh229/koel_music
mkdir music covers

下载Composer

wget https://raw.githubusercontent.com/Hyzual/docker-koel/master/docker-compose.yml
vi docker-compose.yml
# 修改这么几项 - 如图

# 然后进入docker进行init
docker exec -it koel bash
php artisan koel:init

# 启动
docker-compose up -d

# 记住
# APP_KEY=base64:hECAy8VIDQemczDdNlgGWYdLqCvBP+MlRIoySZIPliE=
# JWT_SECRET=GoSOcBmEJ3SwhUvvGpiU0E3epmp2Q9av
# 可以回来修改docker-compose.yml,这样以后就不用怕更新后所有音乐库重建了(APP_KEY和音乐文件本身一起确定唯一性)

在docker里面,出现这个错误是没关系的 – 因为源系统所需要的front-end因为被apache所取代了

这是docker作者的说明

最终的docker-compose.yml文件

version: '3.7'

services:
  koel:
    container_name: koel
    image: hyzual/koel
    restart: always
    depends_on:
      - database
    ports:
      - 8002:80
    environment:
      DB_CONNECTION: mysql
      DB_HOST: database
      DB_USERNAME: koel
      DB_PASSWORD: <your_password>
      DB_DATABASE: koel
      APP_KEY: base64:hECAy8VIDQemczDdNlgGWYdLqCvBP+MlRIoySZIPliE=
      JWT_SECRET: GoSOcBmEJ3SwhUvvGpiU0E3epmp2Q9av
      FORCE_HTTPS: ‘true’
    volumes:
      - /data/gd_stanford/_host/bwh229/koel_music/music:/music
      - /data/gd_stanford/_host/bwh229/koel_music/covers:/var/www/html/public/img/covers

  database:
    container_name: koel_mysql
    image: mysql/mysql-server:5.7
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: <your_password>
      MYSQL_DATABASE: koel
      MYSQL_USER: koel
      MYSQL_PASSWORD: <your_password>

volumes:
  db:
    driver: local
  music:
    driver: local
  covers:
    driver: local

宝塔设置好反代

更新音乐库

网页上更新

terminal手动:

docker exec koel php artisan koel:sync

任何修改后重新启动Composer

docker-compose down && docker-compose up -d

打开CloudFlare Proxy

大功告成。

Leave a Reply