SonosOneDriveServer icon indicating copy to clipboard operation
SonosOneDriveServer copied to clipboard

Create Docker image

Open glacasa opened this issue 3 years ago • 4 comments

I would like to self-host this app with Docker, would you consider creating a Docker image ?

I wanted to do it myself, so I created a Dockerfile : https://github.com/glacasa/SonosOneDriveServer/blob/dockerfile/Dockerfile

But I don't know anything about Java or Maven, so I'm not sure if it is correct. Once deployed, I can access the static xml files, but when I try to add the service in my Sonos customsd.htm, I get an error 500.

glacasa avatar Dec 08 '22 13:12 glacasa

I don't have a docker installation handy right now, so might take a bit to set it up. If you want to try tinkering with it yourself in the meantime, a few years back I had it running on docker with this configuration. It likely requires a few tweaks but could be a good starting point:

FROM ubuntu

RUN apt-get update
RUN apt-get install openjdk-7-jdk --no-install-recommends -y
RUN apt-get install maven -y

ADD . /src

RUN cd /src; mvn clean install

EXPOSE 5000

CMD java -cp /src/target/classes:/src/target/dependency/* SonosOneDriveServer

bertique avatar Dec 11 '22 19:12 bertique

It doesn't build because it seems that openjdk-7-jdk isn't available anymore.

I replaced it with openjdk-18-jdk to be able to build, then the app doesn't start :

Error: Could not find or load main class SonosOneDriveServer
Caused by: java.lang.ClassNotFoundException: SonosOneDriveServer

(I also tried to replace the class name with SonosService because I saw this class in the source, but it didn't help)

glacasa avatar Dec 14 '22 13:12 glacasa

I added a Dockerfile that works locally. You'll still have to configure your Microsoft Graph App id as an environment at runtime.

https://github.com/bertique/SonosOneDriveServer/blob/master/Dockerfile

bertique avatar Dec 22 '22 20:12 bertique

I still get an error 500 when trying to add it to my Sonos

Probably a problem on my side… 😕 Thanks anyway

glacasa avatar Jan 15 '23 15:01 glacasa