Question: Hi I am running an AJAX call to a Flask server using Jquery but it is not returning success response message once i run :

```
os.system("roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/maps/"+mapname+".yaml")

```

Here is the request I am making:

```
$.ajax({ 
    url: '/test', 
    type: 'POST', 
    data: new_freq,
    success: function(response){
        console.log(response);
    },
    error: function(error){
        console.log(error);
    }       
})

```

flask server code,

```
    @app.route("/test" , methods=['POST'])
    def test():
        mapname = request.get_data().decode('utf-8')
        os.system("roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/maps/"+mapname+".yaml")

        return(mapname)

```

anybody knows how to return the AJAX success response?

EDIT:i have replaced the command inside `os.system()` with `ifconfig` and `mkdir` it all works and got the success response.This command `roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/maps/mapname.yaml` initiate a node and never run out.So is there a way i could return the success response even the node is running?

Answer: 
I tried your Compose file on my system and it works as expected - I can access port 7080 both using my host's system IP and hostname and the container's IP and ports 80 and 443 using only the container's IP (since they're not mapped to any of the host's ports).

You did not specify whether you're using Docker for Windows or Docker Toolbox - DockStation works with both, but if you're using Docker Toolbox, then you'll have to use the virtual machine's IP or hostname to access port 7080, instead of `localhost`. If you're using Docker for Windows, then I do not understand what is going on - are you sure the containers are running?

As for where those IP's you mentioned come from - `172.17.0.1` is most likely your hosts IP on Docker's default bridged network. Docker-compose, by default, creates its own bridged networks for every project. In your case, in your project's network, your host's IP would be `172.18.0.1`. You can view Docker's networks with command `docker network ls` and their details with `docker network inspect <network-name>`.

You should not use any of those IP's for any reason, since there's no guarantee they'll remain the same. If you need to connect from outside, map internal container ports to your Docker's host's ports, like you did with port 7080 and if you need containers to connect to each other - with docker-compose you can use service names as hostnames, without it you have to connect them to the same, non-default, bridged Docker network and use their container names as hostnames.
This [solution](https://github.com/docker/for-win/issues/3214#issuecomment-533588317) worked for me.

```
docker run -d -p 127.0.0.1:80:80 tutum/hello-world

```

Apparently you have to specify you want the port exposed under localhost. Then `localhost` entered in the browser address bar loaded the Hello World page - hurrah!

Once I changed the ports in docker-compose.yml to `'127.0.0.1:80:80'` then it also worked when run from DockStation.