Create Docker image
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.
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
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)
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
I still get an error 500 when trying to add it to my Sonos
Probably a problem on my side… 😕 Thanks anyway