How to Setting up a Domain with Docker Compose


#1

Running a High Fidelity Domain with Docker Compose

Along with docker and configuring it, you also need to install docker compose

Create a new folder, and create two files in it,

.env
hifi.yml

Add to .env, You maintain this file when ever there is an update to the high Fidelity client.

HIFI_VERSION=0.70.0

then in docker-compose.yml file

version: "3.6"
services:
  domaina:
    hostname: hifi-domain-a
    image: highfidelity/hifi:${HIFI_VERSION}
    ports:
    - "40100-40109:40100-40109"
    - "40100-40109:40100-40109/udp"
    volumes:
    - "hifiVol1:/root/.local/share/High Fidelity"
volumes:
  hifiVol1: {}

If you want multiple domains on the same machine:

version: "3.6"
services:
  domaina:
    hostname: hifi-domain-a
    image: highfidelity/hifi:${HIFI_VERSION}
    ports:
    - "40100-40109:40100-40109"
    - "40100-40109:40100-40109/udp"
    volumes:
    - "hifiVol1:/root/.local/share/High Fidelity"
  domainb:
    hostname: hifi-domain-b
    image: highfidelity/hifi:${HIFI_VERSION}
    ports:
    - "40110-40119:40100-40109"
    - "40110-40119:40100-40109/udp"
    volumes:
    - "hifiVol2:/root/.local/share/High Fidelity"
  myotherdomain:
    hostname: hifi-domain-c
    image: highfidelity/hifi:${HIFI_VERSION}
    ports:
    - "40120-40129:40100-40109"
    - "40120-40129:40100-40109/udp"
    volumes:
    - "hifiVol3:/root/.local/share/High Fidelity"
volumes:
  hifiVol1: {}
  hifiVol2: {}
  hifiVol3: {}

Advanced method would allow you to hotswap domain versions by having two compose files, both using the same volume names, but different HIFI_VERSION definitions.

General pattern for ports

    ports:
    - "HTTP_PORT:40100"
    - "UDP_PORT_GIVEN:40102/udp"

After thats done, while in the folder, you can run everything

 docker-compose pull # Pulls changes to files, creates volumes if they dont exist, and automatically 
 docker-compose up -d # Runs all compose files at the same time, if some changes, then turns them off and replaces them with the containers created during pull.

When updating you simply update the tag defined in the .env file.

then to turn all things off

docker-compose stop

Then every time you create a new server, you just run pull

Configuring Servers

For Each Domain, connect to each http service you opened up and go through their configurations

You can try using Full automatic, but I didnt have much luck with that, so I kept to IP only.

Then after that is done, forward the router to the machine.

Good luck


Tired of compiling your Linux HiFi server every release? Docker!
#2

that is very cool. I’ll try to follow your indications with docker-compose. It seems a very promising way for solving the problem. The point is that it can be quite heavy to have only one domain with hundreds of heavy models inside, I am under the sensation that heavy domains might call for heavy load under clients, so I wanted to be able to split it in subdomains with teleports, but dont’ want to buy expensive servers only to host multiple subdomains.
Thanks anyway for your continued assistance on newbie questions, you are so helpful @Menithal :slight_smile:


#3

Hi @Menithal I could test your docker-compose and it seems working quite well.

Except… There is something I’m still not grasping in the general configuration and timings of the new domain.

I’d love that somebody from HiFi could help in understanding what to do in the configuration. (I’m speaking even with the very simple configuration with ONE server, surely the hint can help when you have multiple like you are showing with docker-compose).

  1. I was convinced that after configuring the domain you could use simply the IP address as domain name, but it seems it doesnt work :frowning:
  2. So I had to tweak at least the three points shown in the image to get a new domain id (it seems the first time you don’t get it). Sometimes I had to click it various times.
  3. I also needed to change the full update of ip and port this also needed to do various times
  4. and sometimes I tried to unstuck the situation adding a real bought domain
    Even when doing this domain could be notconnectable for many minutes, and then somehow it starts working but can’t understand which action really made it works (!).

Also after it is working for some hours it happens that if I close the client and go away and reopen the interface after a while interface is NOT able to connect to the domain (but the domain is completely ok according to its web console and logs traces are not showing anything).

What I can suspect is that when assigning the domain id there is some time needed for HighFidelity to pick up this information and allow people to make "goto " using the domain id. But I would love to have better information on these timings and which is the exact sequence to do. Yourself are saying that the full automatic you didn’t have luck, so definitely there is something wrong here.