Restrict jenkins only on localhost with docker and nginx Restrict jenkins only on localhost with docker and nginx jenkins jenkins

Restrict jenkins only on localhost with docker and nginx


Remove the ports entry from jenkins. The ports entry is only needed to expose the port of the docker container to the localhost.

To expose the port to another docker container, linking them is sufficient. In your nginx links: you have already mentioned jenkins. Hence you don't need to have the ports entry in your jenkins.

...jenkins:  ...nginx:  links:    - jenkins  ports:    - "80:80"  ...


Try use it

jenkins:  ports:    - "127.0.0.1:8080:8080" nginx:  links:    - jenkins  ports:    - "80:80"