Synology - Docker & MyMedia

Post Reply
flowers
Posts: 2
Joined: Tue Dec 18, 2018 8:16 pm

Synology - Docker & MyMedia

Post by flowers »

Hi,
I installed Docker on my Synology NAS DS416play. There i install https://hub.docker.com/r/bizmodeller/mymediaforalexa/
I have a problem to configure it. I dont reach the website from mymedia. I hope you can help me.

regars
bizmodeller
Posts: 458
Joined: Thu Nov 14, 2013 8:40 pm

Re: Synology - Docker & MyMedia

Post by bizmodeller »

Can you give any more details please? or a screenshot of where you are getting stuck? Thanks
flowers
Posts: 2
Joined: Tue Dec 18, 2018 8:16 pm

Re: Synology - Docker & MyMedia

Post by flowers »

Hi do some screenshots

https://www.dropbox.com/sh/bvrx94cs7nsn ... hIoRa?dl=0

When i try to go to the website http://192.168.178.38:52051
I get a Message that the Site is Not reachable.

Best regards
bizmodeller
Posts: 458
Joined: Thu Nov 14, 2013 8:40 pm

Re: Synology - Docker & MyMedia

Post by bizmodeller »

Thanks - a couple of points from your screenshots.

1. On Volumes, you need two mapped volumes:

/datadir --> should be remapped to a directory that will hold My Media's stateful files - settings and database, etc
/medialibrary --> should be remapped to a directory that holds the media you want to be indexed

.... from your screenshot you have created a mapped volume within the container called /mymedia

This isnt' causing your problem but not having a /datadir will mean your watch folders / configuration won't persist across My Media container restarts

2. On Networks, you have configured an Automatic local port mapped to the two container ports. These can't be automatic, instead you need to map local 52050 to container 52050 and local 52051 to container 52051, i.e.:

Local 52050 --> Container 52050
Local 52051 --> Container 52051

Please also have a look at https://www.mymediaalexa.com/home/docker for further guidance.

Let us know how you get on please
Thomas
Posts: 1
Joined: Tue Dec 25, 2018 12:55 am

Re: Synology - Docker & MyMedia

Post by Thomas »

Hi bizmodeller (and flowers, too)

Could you also insert screenshots so that we can get a concrete example of the correct Docker entries in Synology NAS?
I also thought I entered everything right, but Amazon says the server is not linked correctly.

Many thanks and happy holidays
bizmodeller
Posts: 458
Joined: Thu Nov 14, 2013 8:40 pm

Re: Synology - Docker & MyMedia

Post by bizmodeller »

Unfortunately we don't have a Synology to test with - can any other Synology users kindly provide please?
benjaminchodroff
Posts: 2
Joined: Fri Jan 04, 2019 1:41 am

Re: Synology - Docker & MyMedia

Post by benjaminchodroff »

I'm not a support representative, but I'll try my best to help you. Please understand that Synology NAS with docker has *many* options and I cannot make a guide that covers all possibilities. This tries to capture a default installation. These steps assume you have a working Synology NAS (I used version 6.2.1), you are able to login to the NAS as an administrator, you are connected to the same local network the NAS is on, and you have already installed Docker on the NAS.

1. Login as an administrator on the Synology
2. Launch Docker
3. Click Registry from the left hand navigation
4. In the Search bar, type "bizmodeller/mymediaforalexa" and click "Search"
5. Right click on the result "bizmodeller/mymediaforalexa" and select "Download this image"
6. Wait a few minutes for the image to finish downloading, then click on "Images" in the left hand navigation
7. Select "bizmodeller/mymediaforalexa" and click the "Launch" button
8. Container setup:
(Default) name: bizmodeller/mymediaforalexa1
(Default) Unchecked - Execute container using high priviledges
(Default) Unchecked - Enable resource limitation

Click "Advanced Settings":
Check - Enable auto-restart
Check - Create shortcut on desktop: Web-page http://<yourSynologyNASIPAddress:52051
Click "Volume" tab:
Click "Add Folder":
(I recommend creating a "nas\docker" folder in your NAS volume to store all your local docker settings, I will assume you have done this)
Under nas\docker, create a new directory "mymediaforalexa"
Under nas\docker\mymediaforalexa, create a new directory "datadir"
Select "nas\docker\mymediaforalexa\datadir" and click "Select" button
Mount this directory to "/datadir" and ensure the checkbox for "read only" is not enabled

Click "Add Folder":
Locate the directory which contains all your music, click "Select"
Mount this directory to "/medialibrary". It should be safe to check "read only" if you to avoid having any risks to modifying your media.

Click "Network" tab: No changes required (bridge)
Click "Port Settings" tab:
Under each "Local Port", change it from "Auto" (Which randomly assigns a local port) to instead be the same value as the container port, so:
52050 Local Port -> 52050 Container Port (TCP)
52051 Local Port -> 52051 Container Port (TCP)

Click "Links" tab: No changes required
Click "Environment" tab: No changes required
Click "Apply" button"
Ensure the checkbox for "Run this container after the wizard is finished" is checked, and then click the next "Apply" button.
Click "Container" from the left navigation
In a few seconds, you should see your new container running in this area.

Are you running a firewall on your Synology NAS? You should be! If so, please go into Control Panel->Security->Firewall and edit the rules to the running policy, on the interfaces you need (all interfaces, for example), to allow ports/services for the docker tcp/52050 and tcp/52051. These ports must be accessible to the *local* network which contains your Alexa devices. Alternatively, it is technically possibly to open these ports to the internet to alexa devices outside your local network -- but this may require port forwarding setup in your router which is beyond the scope of this article ;)

Are you running Application Portal on your Synology NAS? I recommend it, but it does require a bit more setup than this guide can fully explain! If so, please go into Control Panel->Application Portal->Reverse Proxy. You can now click "Create", set a description of "mymediaforalexa", source protocol "https" (assuming you have set up SSL certificates on your NAS), hostname: mymediaforalexa.yourdomain.com (assuming you have set up a wildcard DNS entry for yourdomain.com to point to your local network), port: 443 (assuming you have opened port 443 to your local network to the public internet), Check enable HSTS, Check enable HTTP/2, do not enable access control, Destination: protocol HTTP, hostname: localhost (this refers to your NAS where the docker container is running), port: 52051.

You can now connect to mymediaforalexa by going to either:
http://<yourSynologyNASIPAddress:52051
Or, if you followed the Application Portal setup:
https://mymediaforalexa.yourdomain.com

Important:
When running mymediaforalexa in a docker container with bridge mode networking, it will likely automatically detect the docker host IP address *incorrectly*. This will cause your alexa devices to be unable to play songs from your mymediaforalexa. Therefore, you must login to the mymediaforalexa, click "Settings", and under "Listening IP Address" you must click "Set", enable "Override IP Address", and type in the IP address of your Synology NAS (Example: 192.168.1.13). I'm not 100% certain, but you may need to restart the docker container for this take effect.

Known issues:
Every time they upgrade the mymediaforalexa docker image, it blows away your configuration and all saved playlists in /datadir. I hope they fix this or please let me know if anyone knows what I am doing wrong.
fred.k
Posts: 1
Joined: Sun Oct 18, 2020 3:32 pm

Re: Synology - Docker & MyMedia

Post by fred.k »

Good post ! well done benjaminchodroff ;)
just a question

alexa find easyly well know artist
But dont find my own music and album (my creation)
Do you know how i can index my own album ?
mp3 idtag ? or a special file ?
example:i create my own music tittle yoyoyo.mp3 artist :bibi album:friend
I try this without sucess:
alexa ask my media to play yoyoyo or
alexa ask my media to play bibi 's music ?

Any idea ? :?:

thanks
howgreen44
Posts: 3
Joined: Thu Oct 29, 2020 6:27 pm

Re: Synology - Docker & MyMedia

Post by howgreen44 »

Thanks for this great post; it worked well for me after a couple of tries, needing to get all settings correct. Thanks again.
iansb
Posts: 3
Joined: Tue Aug 25, 2020 1:42 pm

Re: Synology - Docker & MyMedia

Post by iansb »

I have tried to install the new docker release of MyMedia on my Synology 218+ with the following command, after stopping and removing the earlier, working version:-

# sudo docker run -d -p 52050:52050 -p 52051:52051 -v /volume1/music:/medialibrary -v /volume1/.MyMediaForAlexa:/datadir bizmodeller/mymediaforalexa

Today, the prompt appears immediately, without any indication of error, and nothing installs.

I'm doing something stupid, but I can't figure it out. Can anyone help?

Ian B.
iansb
Posts: 3
Joined: Tue Aug 25, 2020 1:42 pm

Re: Synology - Docker & MyMedia

Post by iansb »

After posting the above, I found that benjaminchodroff's comprehensive instructions on a manual docker installation worked first time, and I have my music back. Many thanks to Benjamin.

Ian B
audio_inside
Posts: 6
Joined: Tue Jan 05, 2021 5:38 am

Re: Synology - Docker & MyMedia

Post by audio_inside »

Total Docker noob, this was my first time trying to configure a container on my Synology NAS using My Media for Alexa, ran through the Synology instructions and used the Docker Hub to do the install, filled in the details using the MyMedia FAQ. A lot of mysterious parameters (what is "bridge" networking mode?) but I mostly used the defaults, making sure to follow the FAQ's recommendation for the few MyMedia-specific settings.

Only hangup was getting the ports configured correctly, and then it all seemed to be running but no sound. benjaminchodroff's great instructions confirmed that I had already done everything right until his "Important" note: setting the "Listening IP Address" in the server to "Override" and the (thankfully static) IP address of my NAS. Yes, I did restart the container and then Voila! I was successfully playing tracks off my NAS, with artwork display and the whole nine yards.

Have no idea why the Listening IP Address would be set to a seeming random IP address on a random subnet, but it's working now. Thanks benjaminchodroff!
Post Reply