node.jslinuxdockernetworkingdokku

dokku internal connection between apps via docker network


i have multiple apps on dukku ( Nodejs-Express ) lets say :

app1.example.com
app2.example.com
app3.example.com

my app1.example.com connecting to the other apps via HttpRequest.

im logging the speed of connecting and stuff and seems like they are connecting through the internet and not the internal docker network. the speed is more like 900ms or so , so thats not internal speed.

is there a way for me to connect these applications through the docker network ?

im thinking using the /etc/hosts , but i guess that's not much dynamic and its more like static way of doing this . and im not quite sure if that's possible with files.

PS : im managing the addresses with dokku configs . setting environment_variables for app1.example.com and set the addressess and get and use them into the axios requests.


Solution

  • I do this by doing this :

    for example

    app1.web1
    app2.web1
    app3.web1