终于找到大佬了,部署完后,界面和功能都很好,很喜欢,就是发现 node dist/index.js占用cpu过高。
services:
postgres:
image: postgres:16-alpine
container_name: daoliyu-postgres
restart: unless-stopped
environment:
POSTGRES_DB: "daoliyu"
POSTGRES_USER: "daoliyu"
POSTGRES_PASSWORD: "daoliyupassword"
PGDATA: "/var/lib/postgresql/data/pgdata"
command:
- "postgres"
- "-c"
- "max_connections=200"
- "-c"
- "shared_buffers=256MB"
- "-c"
- "work_mem=32MB"
- "-c"
- "maintenance_work_mem=256MB"
- "-c"
- "checkpoint_completion_target=0.9"
- "-c"
- "wal_buffers=16MB"
- "-c"
- "port=5433"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U daoliyu -d daoliyu -p 5433"]
interval: 10s
timeout: 5s
retries: 6
start_period: 30s
ports:
- "5433:5433"
volumes:
- /docker/postgres:/var/lib/postgresql/data
backend:
image: msmkls/daoliyu-backend:0.1.7
container_name: daoliyu-backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
NODE_ENV: production
DATABASE_URL: "postgresql://daoliyu:daoliyupassword@postgres:5433/daoliyu?schema=public&connection_limit=25&pool_timeout=10&statement_timeout=60000&idle_in_transaction_session_timeout=60000"
APP_PORT: 4000
ADMIN_DISPLAY_NAME: "admin" # 管理员用户显示名称
ADMIN_EMAIL: "@qq.com" # 管理员用户邮箱
ADMIN_PASSWORD: "admin123" # 管理员用户密码 (请务必修改为强密码)
LIBRARY_ROOT: "/data/media"
AUDIOBOOK_LIBRARY_ROOT: "/data/audiobooks"
VIDEO_LIBRARY_ROOT: "/data/music-videos"
VIDEO_TRANSCODE_CACHE: "/app/storage/transcoded/videos"
VIDEO_THUMBNAIL_CACHE: "/app/storage/thumbnails/videos"
PLAYLISTS_IMPORT_ROOT: "/data/playlists"
REGISTRATION_OPEN: "${REGISTRATION_OPEN:-true}"
PLUGINS_DIR: "/plugins"
REDIS_URL: "http://192.168.3.3:6379/0"
LOG_LEVEL: "${LOG_LEVEL:-info}"
DEBUG: "${DEBUG:-true}"
volumes:
- /docker/daoliyu/backend-storage:/app/storage # 后端数据
- /media:/data/media # 歌曲目录
- /mnt/file/downloads/有声书:/data/audiobooks # 有声书
- /docker/daoliyu/music-videos:/data/music-videos # 音乐视频
- /docker/daoliyu/playlists:/data/playlists # 歌单目录
- /docker/daoliyu/plugins:/plugins # 占位闲置
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
interval: 30s
timeout: 5s
retries: 5
frontend:
image: msmkls/daoliyu-frontend:0.1.7
container_name: daoliyu-frontend
restart: unless-stopped
depends_on:
backend:
condition: service_started
ports:
- "5173:8080"


