livehouse-automation / docker-sonos-http-api

Docker image containing jishi/node-sonos-http-api: An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar. arm32v7 + amd64 support.
0 stars 1 forks source link

settings.json exists inside container, cant be stored on volume #1

Closed antonywinn closed 4 years ago

antonywinn commented 6 years ago

Created container and mapped volumes:

/cache | /share/Containers/sonos-http/app/cache | Read/Write /clips | /share/Containers/sonos-http/app/clips | Read/Write /presets | /share/Containers/sonos-http/app/presets | Read/Write /settings | /share/Containers/sonos-http/app/settings | Read/Write

Problem is settings.json is stored inside the container (/app/settings.json), and isn't picked up from the /settings volume mapping.

Need to add amazon Polly credentials to the settings.json file

{
  "aws": {
    "credentials": {
      "region": "eu-west-1",
      "accessKeyId": "Your access key id",
      "secretAccessKey": "Your secret"
    },
    "name": "Amy"
  }
}

Mapping /app kills the container entirely. I have used docker trickery in the past to do this.

SSH into your QNAP and use these commands:

docker ps

That will give you the unique ID of the containers running. Then use

docker cp

to copy files in and out of the container. Recommend using the Public share on your QNAP, as containers have limited access. I used:

docker cp dccd7fa3c88e:/app/settings.json /share/Public/ docker cp /share/Public/settings.json dccd7fa3c88e:/app/

To copy the file out, edit it on the share and copy it back in.

Need a tidier alternative - although there may be some merit to embedding this in a container from a "you get 12 months Polly" with every brick deal.

antonywinn commented 6 years ago

I think this issue is actually a problem with a symlink. Refer source docker file:

https://github.com/chrisns/docker-node-sonos-http-api/blob/master/Dockerfile

This line: ln -s settings/settings.json && \

Results in a symlink in /app that doesn't work in the container. Can't cat the file or edit it. Perhaps should it be:

ln -s /settings/settings.json && \

mikenye commented 6 years ago

Should be fixed in commit #93f61c5.