With this repo you will be able to use a docker-compose to spin up your Jenkins server in no time!.
- NGINX proxy to manage your connections.
- Obtain and automatically renew ssl certificates with Let´s Encrypt.
- Volumes for each container mapped to host. Jenkins with named data volumes.
- Configuration centralized in a single file:
.env.
In order to use this compose file (docker-compose.yml) you must have:
- docker (https://docs.docker.com/engine/installation/)
- docker-compose (https://docs.docker.com/compose/install/)
-
Clone this repository:
-
Make a copy of the
.env.sample
and rename it to.env
and update this file with your info and preferences. -
Run the start script
./start.sh
Your Jenkins server is ready to go!
You don´t need to open port
443
in your container, the certificate validation is managed by the web proxy.
Please note that when running a new container to generate certificates with LetsEncrypt (
-e LETSENCRYPT_HOST=your.domain.com
), it may take a few minutes depending on multiples circumstances. Also note that theLETSENCRYPT_TEST=${LETSENCRYPT_TEST:-true}
is set to true in the in the.env
. Change to false when finished debugging and the blog is ready for real traffic. This is to avoid exceeding the certificate rate limit for your domain. More info here.
- To add specific NGINX configurations, such as redirects etc... create a
.conf
file and add it to conf.d directory, while setting theUSE_NGINX_CONF_FILES
to true in the.env.
file. - To use Cloudflare, read and uncomment the necessary lines in the
/conf.d/realip.conf
file.
All credit goes to:
- dockerjenkins_tutorial @maxfields2000
- docker-compose-letsencrypt-nginx-proxy-companion @evertramos
- nginx-proxy @jwilder
- docker-gen @jwilder
- docker-letsencrypt-nginx-proxy-companion @JrCs