使用官方的 Dockerfile 更新了一下 YesPlayMusic 镜像,发现代码有半年没更新了,所以最近又在找可以替代的第三方网易云播放器,今天先给大家带来了 Radishes 
文章传送门:高颜值的第三方网易云播放器YesPlayMusic(续) 
 
什么是 Radishes ? 
Radishes是这个项目的名称,它是由萝卜翻译而来。是跨平台的无版权音乐平台,支持 windows / macos / linux / web 。界面表现和功能参考 windows 网易云音乐界面和 ios 的网易云音乐,会对一些功能进行移动端支持。
 
构建镜像 
如果你不想自己构建,可以跳过,直接阅读下一章节
 
官方没有提供 Docker 镜像,老苏参考 YesPlayMusic 和另一个第三方网易云播放器,写了一个 Dockerfile 文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 FROM  node:16.16  as build-depsMAINTAINER  laosu<wbsu2003@gmail.com>WORKDIR  /app COPY  package.json yarn.lock ./ RUN  yarn install COPY  . ./ RUN  yarn build:web FROM  nginx:1.20 .2 -alpineCOPY  --from=build-deps /app/dist /usr/share/nginx/html COPY  --from=build-deps /app/nginx.conf /etc/nginx/conf.d/default.conf RUN  apk add --no-cache npm RUN  npm install -g NeteaseCloudMusicApi    CMD  nginx && npx NeteaseCloudMusicApi 
 
另外还要准备一个 nginx.conf 文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 server  {  gzip  on ;   listen        80 ;   listen   [::]:80 ;   server_name   localhost;   location  / {     root       /usr/share/nginx/html;     index      index.html;     try_files  $uri  $uri / /index.html;   }   location  @rewrites  {     rewrite  ^(.*)$  /index.html last ;   }   location  /api/ {     proxy_buffers            16  32k ;     proxy_buffer_size        128k ;     proxy_busy_buffers_size  128k ;     proxy_set_header         Host $host ;     proxy_set_header         X-Real-IP $remote_addr ;     proxy_set_header         X-Forwarded-For $remote_addr ;     proxy_set_header         X-Forwarded-Host $remote_addr ;     proxy_set_header         X-NginX-Proxy true ;     proxy_pass               http://localhost:3000/;     } } 
 
构建镜像和容器运行的基本命令如下👇
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 git clone  https://github.com/Linkontoask/radishes.git cd  radishes/docker build -t wbsu2003/radishes:v1 . docker run -d \    --name=radishes \    -p 3331:80 \    wbsu2003/radishes:v1 
 
安装 在群晖上以 Docker 方式安装。
在注册表中搜索 radish,下拉找到 wbsu2003/radishes,版本选择 latest。
端口 本地端口不冲突就行,不确定的话可以用命令查一下
1 2 netstat -tunlp | grep 端口号 
 
命令行安装 如果你熟悉命令行,可能用 docker cli 更快捷
1 2 3 4 5 6 docker run -d \    --restart unless-stopped \    --name radishes \    -p 3331:80 \    wbsu2003/radishes 
 
也可以用 docker-compose 安装,将下面的内容保存为 docker-compose.yml 文件
1 2 3 4 5 6 7 8 9 version:  '3' services:   radishes:      image:  wbsu2003/radishes      container_name:  radishes      restart:  unless-stopped      ports:        -  3331 :80  
 
然后执行下面的命令
1 2 3 4 5 6 7 8 9 10 mkdir  -p /volume1/docker/radishescd  /volume1/docker/radishesdocker-compose up -d 
 
运行 在浏览器中输入 http://群晖IP:3331 就能看到主界面
打开推荐的歌单,随便点了一首歌,还支持歌词显示
用网易云账号登录后,能同步你的歌单
不能扫码登录,只能用手机和邮箱;当然你也可以另外注册一个账号
 
如果你需要其他平台的客户端,可以去下面👇下载
地址:https://github.com/radishes-music/radishes/releases/ 
参考文档 
radishes-music/radishes: Cross-platform copyright-free music platform(跨平台的无版权音乐平台). 支持 windows / macos / linux / web 地址:https://github.com/radishes-music/radishes 
radishes-music 地址:https://radishes-music.vercel.app/music/recommend