Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions netease_cloud_music_api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base:3.20
ARG NCM_API_REF=2c36daf07a4a092df3e5dc66f3acc9e1a9b4c91f
FROM ${BUILD_FROM}

SHELL ["/bin/ash", "-o", "pipefail", "-c"]

RUN apk add --no-cache nodejs npm git

WORKDIR /opt/netease-api

ENV HUSKY=0 \
npm_config_ignore_scripts=1
Comment thread
xiasi0 marked this conversation as resolved.

RUN git clone --depth=1 https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git . \
Comment thread
xiasi0 marked this conversation as resolved.
&& git checkout ${NCM_API_REF} \
&& npm install --omit=dev --no-fund --no-audit \
&& npm cache clean --force

COPY rootfs /

RUN chmod +x /run.sh

EXPOSE 3000

CMD ["/run.sh"]
9 changes: 9 additions & 0 deletions netease_cloud_music_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NetEase Cloud Music API

This add-on runs NeteaseCloudMusicApiEnhanced as a local HTTP API service.

Default endpoint:

- `http://<home-assistant-host>:3000`

Use this URL in the Music Assistant NetEase provider configuration.
11 changes: 11 additions & 0 deletions netease_cloud_music_api/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base:3.20
amd64: ghcr.io/home-assistant/amd64-base:3.20
armhf: ghcr.io/home-assistant/armhf-base:3.20
armv7: ghcr.io/home-assistant/armv7-base:3.20
i386: ghcr.io/home-assistant/i386-base:3.20
labels:
org.opencontainers.image.title: "Home Assistant Add-on: NetEase Cloud Music API"
org.opencontainers.image.description: "Run NeteaseCloudMusicApiEnhanced API service for Music Assistant."
org.opencontainers.image.source: "https://github.com/xiasi0/ha-addon-netease-cloud-music-api"
org.opencontainers.image.licenses: "MIT"
18 changes: 18 additions & 0 deletions netease_cloud_music_api/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: NetEase Cloud Music API
version: "0.1.1"
slug: netease_cloud_music_api
description: NetEase Cloud Music API service for Music Assistant.
url: https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced
startup: services
boot: auto
init: false
arch:
- aarch64
- amd64
- armhf
- armv7
- i386
ports:
3000/tcp: 3000
ports_description:
3000/tcp: NetEase API HTTP
10 changes: 10 additions & 0 deletions netease_cloud_music_api/rootfs/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bashio
set -euo pipefail

export NODE_ENV=production
export PORT=3000

bashio::log.info "Starting NetEase Cloud Music API on 0.0.0.0:${PORT}"

cd /opt/netease-api
exec npm run start