How to avoid a connection refused error on an API with Visual Studio and a docker container?

  docker, http, networking, visual-studio

Since the containment I am working from home with the use of a VPN and I am not able to request an Authentication API for my solution.

I am working on a .Net Core application with two docker container, one is the application the second is the DB2 database and we have an Authentication API the client gave us that we installed on one of our local machine. So everything is currently in the same network once I am connecting through the VPN I guess (I am not a network expert).

Right now, the develop branch is working on the integration server and on my coworker’s PC and he is also working from home through the VPN so we are in the same conditions with the same code.
But I have this error when trying to authenticate :

Connection refused error

The only difference should come from my environment then and I have something different indeed :
– his environment

His configuration

And mine :

enter image description here

As you can see, I have http_proxy configured and I don’t know from where it is coming. It keeps the docker container from getting access to internet so I removed it with a export http_proxy= and was then able to retrieve the ping package with apt-get install iputils-ping.
With this configuration I can ping, ping the local machine where the API is installed, I can even curl the http authentication URL but I am still unable to connect when trying to launch the authentication on the app or the swagger.
I think the problem is located somewhere between the Visual Studio environment/configuration, the docker containers and the network but I can’t found out where.

Here is my docker-compose.yml :

version: '3.4'

    env_file: .DB2env_file
    privileged: true
      context: .DB2
      - 50001:50001
      - 55001:55001
      - .DB2data:/database
      - .DB2scripts:/var/setup
      - .DB2sql:/var/sql
      context: .
      dockerfile: OpenHostService/Dockerfile
    image: ${DOCKER_REGISTRY-}openhostservice
      - db2server
      - 32780:80
            name: ******

I tried with and without our proxy configuration on the global Windows system setting, with and without http_proxy.

Source: StackOverflow