Docker & Docker Swarm configs are strange and don't work
binakot opened this issue · comments
Good day. It's really cool project with great features, but...
I see some configurations for Docker & Docker Swarm environments, I just tried to run it on my Win10 or MacOS. It doesn't work. I guess you have specific network setup on your dev machine.
-
First of all, why is there strong IP hard-coding:
ipv4_address: 172.19.0.6
and so on? -
For what you are set
constraints: [node.role == manager]
? -
Main application is crashed with error on
/opt/monaba/Monaba /var/settings.yml
and message thatsettings.yml
cannot be parsed as valid yaml file. Btw I checked this file in yaml online validator - it was valid. Also I checked the file inside a docker container, file was in the path/var/settings.yml
and contains all configs. -
Why you set host aliases for containers:
search.in
and so on? I didn't find the usage of it. -
What is the reason to use exactly this subnet:
subnet: 172.19.0.0/16
?
Please, help!
Hi! Thanks, glad to hear you like it.
1, 5. I have to hard-code network range because I need a way to determine whether a http request is received from the torgate service. So I just check if IP is 172.19.0.4. It's a dumb and clumsy solution, but I don't know how to do it in a better manner.
2. I've been exploring how Docker Swarm work and how to scale Monaba. Nothing really meaningful here.
3. I used to get this error too, seems that yesod cannot locate settings.yml
file. It should have been copied to the current directory by running ./build
script. Then it's being attached to a docker container via binding to /var/settings.yml
. Make sure you're starting docker-compose from Monaba
directory and have the settings file there. Post settings.yml
here if it won't work for you.
4. It's for developing purpose, if I'm not mistaken.
@ahushh Thanks for feedback.
1,5. I think you should to do next: rename docker-compose.yml
to docker-compose.tor.yml
and add one more file with name docker-compose.yml
withour ip hard-code ips and other specific settings. As for me It is the best and the most flexible solution here.
2. I see.
3. I will try one more time. And If I will got same error I will provide more details.
4. Idk, docker engine create overlay networks itself. I think you use it because of IP hard coding. For my case without TOR I can just remove it.
This is my working docker-compose and settings. https://gist.github.com/binakot/d86d4107c5d46e2eae79339aeed4fac0