洛雪音乐同步服务器(增强版),内置 Web 播放器、下载管理、投屏等功能。
Enhanced LX Music sync server with built-in web player, download manager, and casting support.
镜像地址 / Image: penhaijun/lx-music-server
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.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
只需挂载以下两个卷即可,容器会自动在 /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 | ./data | SQLite 数据库、用户数据、日志 / SQLite DB, user data, logs |
/server/music | ./music | 音乐主目录(下载 + 缓存 + 本地库)/ Music dir (download + cache + local lib) |
注意:无需单独挂载
logs或cache目录,它们已包含在上述卷中。Note: No need to mount
logsorcacheseparately — they are included in the volumes above.
环境变量优先级高于 config.js。以下为常用配置,完整列表请查阅 README。
Environment variables take precedence over config.js. Below are common options — see README for the full list.
| 变量 / Variable | 默认值 / Default | 说明 / Description |
|---|---|---|
PORT | 9527 | 服务端口 / Service port |
FRONTEND_PASSWORD | 123456 | 管理后台访问密码 / Admin panel password |
ADMIN_PATH | /admin | 后台管理路径 / Admin panel path |
PLAYER_PATH | /music | Web 播放器路径 / Web player path |
| 变量 / Variable | 默认值 / Default | 说明 / Description |
|---|---|---|
ENABLE_WEBPLAYER_AUTH | false | 开启 Web 播放器访问密码 / Enable web player password |
WEBPLAYER_PASSWORD | 123456 | Web 播放器密码 / 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}'
| 变量 / 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 |
启动容器后,通过浏览器访问 / After starting, access via browser:
| 服务 / Service | 地址 / URL | 说明 / Note |
|---|---|---|
| Web 播放器 / Web Player | http://localhost:9527/music | 在线音乐播放器 / Online music player |
| 管理后台 / Admin Panel | http://localhost:9527 | 默认密码 123456 / Default password 123456 |
如需自行构建并推送到 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(仅单架构)。
--pushbuilds and pushes simultaneously. For local testing, remove--pushand add--load(single arch only).
docker logs -f lx-sync-server
docker compose pull && docker compose up -d
镜像已内置 Asia/Shanghai 时区。如需修改,挂载 /etc/localtime:
The image has Asia/Shanghai timezone built-in. To change, mount /etc/localtime:
-v /etc/localtime:/etc/localtime:ro
通过 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
-e PROXY_ALL_ENABLED=true
-e PROXY_ALL_ADDRESS=http://127.0.0.1:3128 # 支持 http:// 或 socks5://
Content type
Image
Digest
sha256:225e06e7e…
Size
108.5 MB
Last updated
about 2 months ago
docker pull penhaijun/lx-music-server