Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running two separate minimservers using docker?
14-07-2020, 17:36
Post: #1
Running two separate minimservers using docker?
Hi,

Just started using minimserver after some 10 year old squeezebox units stopped working, and it's really useful.

I'm trying to work out how to run two separate services with different music libraries, using docker services.

I've got one running, based [on this version](https://github.com/Trauma/docker-minimserver) just updated to use `openjdk:9` and `MinimServer-0.8.5.2-linux-armhf.tar.gz`.

I've just used the [config file here](https://github.com/Trauma/docker-minimse...r.config), and when I run two containers (on different ports) my client ([Hifi Cast on Android](https://play.google.com/store/apps/detai...t&hl=en_GB)) gets confused.

How should I label the different services, so that they can both be recognised?

Do I need to change `minimserver.udn = 3d5fc5dc-0b4d-4de9-a9c9-5a550a9e1b46` and if so, how?
Find all posts by this user
Quote this message in a reply
14-07-2020, 18:04
Post: #2
RE: Running two separate minimservers using docker?
You should change the Dockerfile so that it doesn't copy the preconfigured minimserver.config file. MinimServer will create this file itself with correct settings.
Find all posts by this user
Quote this message in a reply
15-07-2020, 08:08
Post: #3
RE: Running two separate minimservers using docker?
(14-07-2020 18:04)simoncn Wrote:  You should change the Dockerfile so that it doesn't copy the preconfigured minimserver.config file. MinimServer will create this file itself with correct settings.

Thanks. Does that survive a container restart or do I need to copy the generated minimserver.config out and mount it?
Find all posts by this user
Quote this message in a reply
15-07-2020, 08:10 (This post was last modified: 15-07-2020 08:16 by simoncn.)
Post: #4
RE: Running two separate minimservers using docker?
The image should not contain any minimserver.config file. Each container will contain a (different) generated file and this will survive container stops and restarts.

Edit: The above is what happens with the approach I am using to create containers. It might not work with the Dockerfile you are using. See this post for details of the recommended approach.
Find all posts by this user
Quote this message in a reply
15-07-2020, 15:54
Post: #5
RE: Running two separate minimservers using docker?
I'm trying to do it without the need for minimwatch, and have one service working fine. I don't seem to be able to get a second though. I've tried a few things, but have run out of ideas!

I'm attempting to run the second service on different ports, but can't seem to update the `minimserver.config` file.

I've tried exec into container and running `prop http.port=9792 ` , but I get a permission error trying to edit `minimserver.config`

If I edit the `minimserver.config` on the host machine and bind it to the container, I get:

Code:
MinimServer 0.8.5.2, Copyright (c) 2012-2017 Simon Nash. All rights reserved.
Integrity check value missing in file minimserver.config
MinimServer failure: now stopped, use 'relaunch' or 'exit'
Enter command (? for help):

Specifically I want to add the following to the config file

Code:
minimserver.contentDir = /Music
minimserver.ohnet.port = 9793
minimserver.http.port = 9792


For info my `docker-compose.yml` is as follows.

Code:
services:
  minimserver-svc2:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: minimserver-svc2
    image: minimserver:0.8.5.2
    network_mode: "host"
    restart: always

    volumes:
      - "/mnt/Music:/Music"
      - type: bind
        source: ./minimserver.config
        target: /opt/minimserver/data/minimserver.config
    expose:
      - 1900
      - 9792
      - 9793
    ports:
      - 9792:9792
      - 9793:9793

version: "3.5"



Lastly I tried running a `docker-entrypoint.sh` like this , but that failed too...

Code:
#!/bin/sh

/opt/minimserver/bin/startc
prop http.port=9792
prop ohnet.port=9793
prop contentDir=/Music
restart
Find all posts by this user
Quote this message in a reply
15-07-2020, 21:00
Post: #6
RE: Running two separate minimservers using docker?
You might be able to do this by placing a minimserver.defaults file in the minimserver/data folder before you run the startc command. This file should contain the following:

Code:
minimserver.contentDir = /Music
ohnet.port = 9793
http.port = 9792

Do not attempt to put a minimserver.config file in this folder, only the minimserver.defaults file.
Find all posts by this user
Quote this message in a reply
15-07-2020, 22:09
Post: #7
RE: Running two separate minimservers using docker?
Thanks, that appears to work. I can access the web control for both servers.

I can't yet get both servers to show up in my control point, but will look into why that is tomorrow.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)