Contributes to https://github.com/jishi/node-sonos-http-api. Look there for further details.
This is the Dockerfile which is used for cross-build on a Mac and based on a proper nodejs image (look at https://hub.docker.com/r/fgabriel/rpi-nodejs/) which is again based on a proper debian testing image (for further details look at repository https://hub.docker.com/r/fgabriel/rpi-armv7hf-debian-qemu/):
MAINTAINER Ferdinand Gabriel <email@example.com>
RUN [ "cross-build-start" ]
RUN mkdir /usr/src/app && mkdir /root/.sonos-http-api
ADD package.json /usr/src/app
RUN npm install --production
EXPOSE 3500 5005
ADD . /usr/src/app
RUN ln -s /root/.sonos-http-api/settings.json settings.json
CMD [ "npm", "start" ]```
RUN [ "cross-build-end" ]
Before building the docker image, you have to download the current package.json from https://github.com/jishi/node-sonos-http-api. It is copied to the image and needed for installation of the packages.
This container has to be run with this command
docker run -d --name sonos-http-api --net=host --restart=always -v /etc/localtime:/etc/localtime:ro -v /[mount volume]:/root/.sonos-http-api:rw fgabriel/rpi-node-sonos-http-api:latest
whereby mount volume can store the settings.json file. E.g. if you want to use the text-to-speed function and you have to define your API-key for voicerss.org in the settings.json.