Redirect sub domain to a container (Apache/Gitlab)

Hi,

You could also use this to redirect subdomains to containers dynamically: https://github.com/jwilder/nginx-proxy.

This Nginx-based tool automatically redirects requests to the appropriate container (based on the given subdomain using the VIRTUAL_HOST container environment variable).

I wrote a tutorial about it: http://blog.florianlopes.io/host-multiple-websites-on-single-host-docker.

For your use case, you would simply run the nginx-proxy container (port 80) and run the GitLab container (whatever port you like, provided it is exposed) with the “VIRTUAL_HOST=gitlab.example.com” environment variable.