B4J Question Dockers and JServer apps

Magma

Expert
Licensed User
Longtime User
I am thinking creating something like my own docker for jserver apps. I saw this thread https://www.b4x.com/android/forum/t...n-linux-docker-container.170250/#post-1042334

Probably will be a jserver app too... but i wanna ask how will manage the ports and if is possible to have same ports somehow or need to change from server-app to server-app...

The real question is more debian/ubuntu question how can multiple ips and possible.. and if anyone did something like this?

In jserver is it possible to set the ip will use ? or better is it possible to set domain have the same ip (like apache is doing)?
 

hatzisn

Expert
Licensed User
Longtime User
All you need is some docker knowledge and a Dockerfile . Check my signature in "my contributions" in B4J tutorials to get a grip of how this is done. Please note also that I wrote this tutorial when I was learning docker and cybersecurity-wise is way far behind best practices on the matter. In docker you can map ports but if you only use http/https protocol you can use a reverse proxy to divert traffic directly inside the container.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Nice... @hatzisn
you prob mean that

may be i m saying wrong.... i dont think need to have them in different img .. so my thought is not using exactly dockers but my .jar executing the same time... with different domains... different IPs just saw it by Erel's point...which is a nice solution

also yours is nice.. but from my view is getting a lot of ram and cpu usage. sure is more secured...

From my view every jar is different system and thats because will be only mine at least at starr.

So i will need a maiin jar that will manage all my dockers-jar using same style of a configuration.. the manager will start-stop jservers.. and will show logs...

The only thing must find how to use diff domains with same ip, same port at least in front and then forward at internal diff port of each jserver-docker..
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Nice... @hatzisn
you prob mean that

may be i m saying wrong.... i dont think need to have them in different img .. so my thought is not using exactly dockers but my .jar executing the same time... with different domains... different IPs just saw it by Erel's point...which is a nice solution

also yours is nice.. but from my view is getting a lot of ram and cpu usage. sure is more secured...

From my view every jar is different system and thats because will be only mine at least at starr.

So i will need a maiin jar that will manage all my dockers-jar using same style of a configuration.. the manager will start-stop jservers.. and will show logs...

The only thing must find how to use diff domains with same ip, same port at least in front and then forward at internal diff port of each jserver-docker..

Actually they consume only space and not that much memory and processing time. What you are describing for starting the webapps already exists and it is called Kubernetes (but it is for containers). Both for containers of docker and Kubernetes you can take a look at the playlists of Christian Lempa's channel in YouTube. I learned a lot from him.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Yeap i know that... also already know some dockers ready solutions doing that i want... but i want mine solution...
i think with ufw commands will do that port forwarding ... but don't know how will bind domains and if need binding... may be no need anything..
🤔
 
Upvote 0
Top