Using self hosted gitlab npm modules in Docker container

Intro

I've been containerising all my projects at work recently to make the builds more consistent and ultimately to allow us to use those builds for production. I recently ran into the issue on our on premise installation of gitlab of how to pull git repo's as npm modules from our protected internal gitlab during continuous integration (CI) builds when using docker.