Sign inSign up

penhaijun/lx-music-server

By penhaijun

•Updated about 2 months ago

lx music

Image
0

10K+

penhaijun/lx-music-server repository overview

⁠LX Music Sync Server - Docker 部署指南 / Docker Deployment Guide

洛雪音乐同步服务器(增强版),内置 Web 播放器、下载管理、投屏等功能。

Enhanced LX Music sync server with built-in web player, download manager, and casting support.

镜像地址 / Image: penhaijun/lx-music-server


⁠快速开始 / Quick Start

⁠方式一:Docker Run / Option 1: Docker Run
docker run -d \
  -p 9527:9527 \
  -v $(pwd)/data:/server/data \
  -v $(pwd)/music:/server/music \
  --name lx-sync-server \
  --restart unless-stopped \
  penhaijun/lx-music-server:latest
⁠方式二:Docker Compose / Option 2: Docker Compose

新建 docker-compose.yml 文件 / Create a docker-compose.yml file:

services:
  lx-sync-server:
    image: penhaijun/lx-music-server:latest
    container_name: lx-sync-server
    restart: unless-stopped
    ports:
      - "9527:9527"
    volumes:
      - ./data:/server/data
      - ./music:/server/music
    environment:
      - FRONTEND_PASSWORD=your_admin_password  # 管理后台密码 / Admin panel password
      # - ENABLE_WEBPLAYER_AUTH=true            # 开启 Web 播放器密码 / Enable web player auth
      # - WEBPLAYER_PASSWORD=your_player_password
      # - LX_USER_myuser=mypassword             # 快速添加同步用户 / Quick add sync user

启动 / Start:

docker compose up -d

⁠数据持久化 / Data Persistence

只需挂载以下两个卷即可,容器会自动在 /server/music 下创建 download、cache、local_lib 子目录。

Only two volumes are needed. The container automatically creates download, cache, and local_lib subdirectories under /server/music.

容器路径 / Container Path宿主建议 / Host Suggested用途 / Purpose
/server/data./dataSQLite 数据库、用户数据、日志 / SQLite DB, user data, logs
/server/music./music音乐主目录(下载 + 缓存 + 本地库)/ Music dir (download + cache + local lib)

注意:无需单独挂载 logs 或 cache 目录,它们已包含在上述卷中。

Note: No need to mount logs or cache separately — they are included in the volumes above.


⁠环境变量配置 / Environment Variables

环境变量优先级高于 config.js。以下为常用配置,完整列表请查阅 README⁠。

Environment variables take precedence over config.js. Below are common options — see README⁠ for the full list.

⁠基础配置 / Basic
变量 / Variable默认值 / Default说明 / Description
PORT9527服务端口 / Service port
FRONTEND_PASSWORD123456管理后台访问密码 / Admin panel password
ADMIN_PATH/admin后台管理路径 / Admin panel path
PLAYER_PATH/musicWeb 播放器路径 / Web player path
⁠认证与用户 / Authentication & Users
变量 / Variable默认值 / Default说明 / Description
ENABLE_WEBPLAYER_AUTHfalse开启 Web 播放器访问密码 / Enable web player password
WEBPLAYER_PASSWORD123456Web 播放器密码 / Web player password
LX_USER_<用户名>-快速添加同步用户,值为密码 / Quick add sync user, value is password

添加用户示例 / Add user example:

# 添加用户 alice,密码为 mypass
# Add user "alice" with password "mpass"
-e LX_USER_alice=mypass

# 也可使用 JSON 格式指定更多属性
# Or use JSON format for additional options
-e LX_USER_bob='{"password":"mypass","maxSnapshotNum":20}'
⁠路径配置 / Paths(通常无需修改 / Usually no need to change)
变量 / Variable容器内默认值 / Default in Container说明 / Description
DATA_PATH/server/data数据目录 / Data directory
DOWNLOAD_PATH/server/music/download下载目录 / Download directory
CACHE_PATH/server/music/cache缓存目录 / Cache directory
LOCAL_LIB_PATH/server/music/local_lib本地音乐库 / Local music library

⁠访问地址 / Access URLs

启动容器后,通过浏览器访问 / After starting, access via browser:

服务 / Service地址 / URL说明 / Note
Web 播放器 / Web Playerhttp://localhost:9527/music在线音乐播放器 / Online music player
管理后台 / Admin Panelhttp://localhost:9527默认密码 123456 / Default password 123456

⁠高级用法 / Advanced

⁠自行构建镜像 / Build from Source

如需自行构建并推送到 Docker Hub / Build and push to Docker Hub:

# 1. 创建多架构构建器(仅需一次)/ Create multi-arch builder (once only)
docker buildx create --name multiarch --use

# 2. 构建 amd64 + arm64 双架构并推送 / Build amd64 + arm64 and push
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t penhaijun/lx-music-server:latest \
  -t penhaijun/lx-music-server:1.9.0 \
  --push .

--push 会同时构建并推送。如需本地验证,去掉 --push 加 --load(仅单架构)。

--push builds and pushes simultaneously. For local testing, remove --push and add --load (single arch only).

⁠查看日志 / View Logs
docker logs -f lx-sync-server
⁠更新镜像 / Update Image
docker compose pull && docker compose up -d

⁠常见问题 / FAQ

如何修改时区? / How to change timezone?

镜像已内置 Asia/Shanghai 时区。如需修改,挂载 /etc/localtime:

The image has Asia/Shanghai timezone built-in. To change, mount /etc/localtime:

-v /etc/localtime:/etc/localtime:ro
如何使用自定义 config.js? / How to use custom config.js?

通过 CONFIG_PATH 环境变量指定外部配置文件:

Use CONFIG_PATH to specify an external config file:

-v $(pwd)/my-config.js:/server/config.js
-e CONFIG_PATH=/server/config.js
如何开启代理? / How to enable proxy?
-e PROXY_ALL_ENABLED=true
-e PROXY_ALL_ADDRESS=http://127.0.0.1:3128   # 支持 http:// 或 socks5://

Tag summary

Content type

Image

Digest

sha256:225e06e7e…

Size

108.5 MB

Last updated

about 2 months ago

docker pull penhaijun/lx-music-server