Connecting to the host from within the docker container

I’m using a docker image inside the gitlab.yml file. The pipeline runs an R script that connects to the localhost using IP (or URL).

How can I connect to the Host from within the docker container?

Using IP of the host will work.

Thank you!