Skip to content

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

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

主要的Docker网站

  • https://raw.githubusercontent.com/koel/docker/master/docker-compose.mysql.yml
  • https://github.com/koel/docker

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

在Google Drive上创建文件目录

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

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

下载Composer

wget https://raw.githubusercontent.com/koel/docker/master/docker-compose.mysql.yml

vi docker-compose.yml
# 修改这么几项 - 如图

# 然后进入docker进行init
export KOEL_DOCKER="koel_music_koel_1"
docker exec --user www-data -it $KOEL_DOCKER bash
# Once inside the container, you can run commands:
$ php artisan koel:init --no-assets

docker exec -it $KOEL_DOCKER php artisan koel:admin:change-password

# 启动
docker-compose up -d

最终的docker-compose.yml文件

version: '3'

services:
  koel:
    image: phanan/koel
    depends_on:
      - database
    ports:
      - 8002:80
    environment:
      - DB_CONNECTION=mysql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=koel-password
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: mysql/mysql-server:5.7
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=koel-password
      - MYSQL_DATABASE=koel
      - MYSQL_USER=koel
      - MYSQL_PASSWORD=koel-password

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

宝塔设置好反代

更新音乐库

网页上更新

terminal手动:

docker exec koel php artisan koel:sync

任何修改后重新启动Composer

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

打开CloudFlare Proxy

大功告成。

Leave a Reply

Your email address will not be published.