I’m trying to create an addon for this docker that I found but I cant really get it to work. I’m not 100% sure of what I’m doing when I try ti fix this.
The link above is the link for the docker to a api for sonos that I hade before but now I think I would need some help to make it an addon instead.
Is there anyone who can help me in the right direction?
I’ve tried to get this up and running today. However I’ve been running into trouble. The addon builds well, but on startup it becomes obvious the npm install fails on a raspberry. The same dockerfile works well however on another host, so I’m pretty stuck here.
Dockerfile
ARG BUILD_FROM
FROM $BUILD_FROM
ENV LANG C.UTF-8
WORKDIR /data
# Do the installation
RUN apk --no-cache add nodejs nodejs-npm tar curl && \
curl -L https://github.com/jishi/node-sonos-http-api/archive/master.tar.gz | tar xz --strip-components=1 -C /data && \
npm install --production && \
rm -rf /tmp/* /root/.npm
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
# Healthceck (probably not really necessary)
#HEALTHCHECK --interval=1m --timeout=2s \
#CMD curl -LSs http://localhost:5005 || exit 1
# The actual command
CMD [ "/run.sh" ]
run.sh
if [ ! -d /data/static ]; then
mkdir /data/static
fi
if [ ! -d /data/static/clips ]; then
mkdir /data/static/clips
chown -R node:node /data/static
fi
if [ ! -d /data/settings ]; then
mkdir /data/settings
fi
if [ ! -d /data/cache ]; then
mkdir /data/cache
chown -R node:node /data/cache
fi
if [ ! -d /data/presets ]; then
mkdir /data/presets
fi