[NB] If the docker-compose up and the docker container won't connect to the host network, make sure you have a defined network in your docker-compose file.
version: "3"
services:
name_of_your_service:
build: .
image: name_of_your_image
network_mode: host
[NB] If you are using Docker Desktop for Windows, this network section should have a "default" instead of "host". host only works on Linux based Operating System.