Code Monkey home page Code Monkey logo

docker-jenkins-nginx-letsencrypt's Introduction

docker-jenkins-nginx-letsencrypt

Dockerised Jenkins with SSL support using Nginx and Let's Encrypt

Requirements

Docker and docker-compose:

Usage

Your domain example.com needs to be publicly resolvable and accessible from the internet.

Modify the domain and e-mail address inside the docker-compose.yml:

# Used by `nginx-proxy` to automatically proxy the traffic to the `nginx` docker
VIRTUAL_HOST: example.com
# Used by `letsencrypt-nginx-proxy-companion` to generate SSL certificates
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: [email protected]

Bring up the services:

docker-compose up

Access your jenkins on: https://example.com Note that on the first run it could take few minutes to initialise the Let's Encrypt.

Local testing

For development purposes, you could run boulder, the CA server behind Let's Encrypt: https://letsencrypt.readthedocs.io/en/latest/contributing.html#integration-testing-with-the-boulder-ca

Alternatively you can use ngrok.io. Their free service is sufficient to test this example.

  • Register with https://ngrok.io and download ngrok app
  • Run locally ngrok http 80 and note yoursubdomain.grok.io
  • Replace example.com inside docker-compose.yml with yoursubdomain.ngrok.io and [email protected] with your e-mail address
  • Add to your /etc/hosts the mapping to the ngrok domain: 127.0.0.1 yoursubdomain.ngrok.io. You need this step, otherwise your call to this domain will be routed through ngrok.io.
  • Run docker-compose up

What happens after running this example is the following:

  • Let's encrypt will generate new certificate
  • It will call yoursubdomain.ngrok.io/.well-known/acme-challenge which will be redirected to our localhost, courtesy of ngrok.io You can confirm this behaviour when checking: http://localhost:4040/inspect/http
  • Navigate to https://yoursubdomain.ngrok.io and setup your Jenkins.

References:

docker-jenkins-nginx-letsencrypt's People

Contributors

rathko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.