
data/conf.d directories before you run docker-compose up -d. data/nf file and /etc/nginx/conf.d directory to. data/nf:/etc/nginx/nfįor the NGINX container, I am mapping the /etc/nginx/nf to the local. Here is the NGINX’s docker-compose.yaml file that I’ve got. This way the URL is easier to remember and also protected by SSL communication. You may want to have URLs that looks like the following. It’s the best practice nowadays that even internal web applications are protected by encrypted communication by SSL. Moreover, NGINX can be the front man to service SSL communication. By having NGINX reverse proxy in place in front of the Jenkins instances on the Docker host, it solves the problem. It would mean you would have to open more ports as you have more instances of Jenkins on the same Docker host. However, it’s limited in a sense that if you want to have another instance of Jenkins on the same machine, you would have to use another port like and if you need another instance. It would be operational enough to use the Jenkins container as the way it is. If you want to stop the container, you can just run docker-compose down. If you save this file as docker-compose.yaml and run docker-compose up -d and then access it on your browser you should see the initial set up UI. jenkins_home directory where all the data is persisted. Please note that you should run mkdir jenkins_home (create the directory) beforehand to make sure you won’t get an error because as you can see it in docker-compose.yaml, /var/jenkins_home in the container is mapped to the host’s. JENKINS_LOG=/var/jenkins_home/logs/jenkins.log Here is the initial Docker Compose file (YAML) I created. Jenkins on Dockerįirst of all, I need to provision a Jenkins container. It is important to understand the network aspect of containerization. It will increase the network security level to the next level. It’s because I am planning to provision NGINX as a Docker container and I want the NGINX container to communicate with Jenkins container within the Docker network without using the host network. Based on the CIDR, the network can host up to 65,536 containers which is way more than enough for normal operations. This means that it’s within the range of the CIDR 172.25.0.1/16 listed in the br-1418967f1f10 bridge network above.
