NetEase Cloud Music API 標準版デプロイ
NeteaseCloudMusicApi プロジェクトベース。
環境要件
- Node.js 14+
推奨方式
| 方式 | 向いている用途 | 入口 |
|---|---|---|
npm install | 長期運用・依存固定あり | npm install NeteaseCloudMusicApi@latest |
npx | クイック検証 | npx NeteaseCloudMusicApi@latest |
bunx | Bun でのワンショット起動 | bunx NeteaseCloudMusicApi@latest |
| Docker Compose | コンテナでの長期運用 | oven/bun:alpine + bunx NeteaseCloudMusicApi |
::: note npm install は長期運用向きです。npx / bunx は初回実行時にパッケージを取得するため、クイック検証向きです。 :::
NPM パッケージデプロイ
1. 作業ディレクトリを初期化
shell
mkdir netease-cloud-music-api
cd netease-cloud-music-api
npm init -y2. 依存関係をインストール
shell
npm install NeteaseCloudMusicApi@latest3. 実行
shell
npx NeteaseCloudMusicApi4. ポートのカスタマイズ
Linux/macOS
shell
PORT=4000 npx NeteaseCloudMusicApiWindows
bat
set PORT=4000 && npx NeteaseCloudMusicApiNPX / Bunx クイック起動
デフォルトポート 3000
shell
npx NeteaseCloudMusicApi@latestshell
bunx NeteaseCloudMusicApi@latestポート変更
shell
PORT=4000 npx NeteaseCloudMusicApi@latestshell
PORT=4000 bunx NeteaseCloudMusicApi@latestWindows
bat
set PORT=4000 && npx NeteaseCloudMusicApi@latest
set PORT=4000 && bunx NeteaseCloudMusicApi@latestDocker Compose デプロイ
ここでは Bun ベースイメージ内で bunx NeteaseCloudMusicApi を直接実行する構成を使います。古いプリビルドイメージに依存しません。
yaml
services:
ncm-api:
image: oven/bun:alpine
container_name: ncm-api
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- "127.0.0.1:3000:3000"
command: bunx NeteaseCloudMusicApi
networks:
- 1panel-network
deploy:
resources:
limits:
memory: 256M
networks:
1panel-network:
external: true起動コマンド:
shell
docker compose up -d1Panel を使わない場合は 1panel-network を自分のネットワーク名に置き換えるか、networks セクションを削除して Compose のデフォルトネットワークを使ってください。
よくある質問
ログイン失敗
ログインできない問題が発生した場合は、メールアドレスログインをお試しください。