DOCKER : Gitlab working but GIT url is wrong


I am running a self hosted Docker Gitlab latest version.
I am adding environment variables to my docker in portainer:
GITLAB_HOST : 5x.1xx.3x.1xx:40080
EXTERNAL_URL : 5x.1xx.3x.1xx:40080

Gitlab is working and starting.
But when I am in VS code the URL is wrong.
It does not take the GITLAB_HOST. I have no idea why

I would like to solve this using environement variables.
How do we solve this then?

Thanks for your help


You can see in the official docs how to use env variables to pre-configure GitLab in Docker.

Anyway GitLab configuration is relying on gitlab.rb file, creating one and mounting it into the docker container is preferred.