1

I have a running container with nginx-proxy and a gitlab container with -env VIRTUAL_HOST=gitlab.dev

How can I make gitlab.dev accessible from other computers in my local network?

Im running CentOS7

My config:

Step 1:

docker run -d -p 80:80 --name nignx-proxy -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy

Step 2:

docker run --detach  \
    --hostname gitlab.dev \
    --env VIRTUAL_HOST=gitlab.dev \
    --publish 8080:80 --publish 8022:22 \
    --name gitlab \
    --restart always \
    --volume /home/test/docker-projects/gitlab/config:/etc/gitlab \
    --volume /home/test/docker-projects/gitlab/logs:/var/log/gitlab \
    --volume /home/test/docker-projects/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

Step 3

hostmachine IP is 192.168.21.12 so I added the following to /etc/hosts file

192.168.21.12 gitlab.dev
robert
  • 797
  • 3
  • 9
  • 23

1 Answers1

1

1) use a local install of nginx and set up a reverse proxy for that domain name to the correct port

2) map the port from the container to your computer

3) edit your hosts file to add a gitlab.dev entry, pointing at the nginx reverse proxy IP address

this is true regardless of what operating system you are running for your host.

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
  • I use nginx-proxy by jwilder. I updated my post to show the steps I have done. I don't see any differences to your advices? – robert May 09 '17 at 12:19