@daveyx
Hi,
in the part of the documentation where it says: replace "MYDOCKERHOST:PORT"
you should replace MYDOCKERHOST
with the hostname/IP-Address where your client’s browsers are able to reach the metasfresh webui and PORT
should be replaced by the portnumber your client’s browsers will connect to the webui.
As an example, let’s assume you have a Server/VM running where you want to host the metasfresh-stack using docker.
The hostname of your server where you installed docker and docker-compose is: myprivateserver
The IP address of the eth0
adapter that you want to host the stack is: 192.168.100.1
You don’t have a SSL certificate so you’re using the default http-port: 80/TCP
You should replace MYDOCKERHOST:PORT
with either:
myprivateserver:80
or
192.168.100.1:80
Your browser is then able to access the metasfresh-stack using either:
http://myprivateserver/
or
http://192.168.100.1/
In general you shouldn’t use the IP-Addresses docker assigns to the containers, since it may vary (think of having 5 different metasfresh-docker stacks on the SAME server/VM ).
Instead, use the IP address of your server/VM and change the port for the webui
container as described here.
A different example:
you want to host 3 metasfresh-docker-stacks on the same machine (server/VM) with following specifications:
Hostname of your server/VM: myprivateserver
IP-Adress of your server/VM: 192.168.100.1
Port-Range you want to use the browsers to connect to: 8181-8183
The first stack would use these settings:
docker-compose.yml:
...
webui:
...
ports:
- "8181:80"
...
config.js:
const config = {
API_URL: 'http://myprivateserver:8181/rest/api',
WS_URL: 'http://myprivateserver:8181/stomp'
}
The second stack would have a config like this:
docker-compose.yml:
...
webui:
...
ports:
- "8182:80"
...
config.js:
const config = {
API_URL: 'http://myprivateserver:8182/rest/api',
WS_URL: 'http://myprivateserver:8182/stomp'
}
and so on…
So if your clients should use the first metasfresh-stack to work with, their browser-url should be:
http://myprivateserver:8181
For the clients who should access the second stack, the should type http://myprivateserver:8182
in the URL-bar of their browsers.
There is no need to expose port webapi:8080/TCP
at all!
And as I wrote in my post above:
You might want to expose the webapi-port directly but that would only be for developing and debugging.
And even then, you should use the IP of your physical adapter of the server (eg.: eth0
) to connect to the webapi-instance and instead of using the docker-container IP, you should alternate exposed ports.
Cheers,
Julian