Problem with the proxy using ZAP Docker Image GitLab

I’m trying to use ZAP in my GitLab repository. (link to the docker image for ZAP: https://github.com/zaproxy/zaproxy/wiki/Docker)

After running the specific CLI command, i get this error:

requests.exceptions.ProxyError: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: http://zap/JSON/ascan/action/scan/?apikey=&url=https%3A%2F%2Ftargetwebsite%2Flanding&recurse=False (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f83a9dcc588>: Failed to establish a new connection: [Errno 111] Connection refused',)))

Has anyone already had the same problem or knows how I could solve it? Thank you all!

Source: StackOverflow