Giter VIP home page Giter VIP logo

docker-compose-local-https's Introduction

Docker Compose local HTTPS

Examples of local HTTPS with docker-compose + mkcert

Prerequisites

Run mkcert -install

Run ./init.sh (creates local certificates using mkcert and copies them to where the Caddy and nginx examples expect them)

The setup

Each example has a barebones Node app running on the official Node 10 Docker image running on port 8080.

The Node code is at ./caddy/app/index.js, ./caddy-gen/app/index.js and ./nginx/app/index.js.

It also has a reverse-proxy set up using Caddy and nginx respectively which

Caddy Example with Caddyfile

Caddy is the HTTP/2 web server with automatic HTTPS.

https://caddyserver.com/

See ./caddy, uses https://github.com/abiosoft/caddy-docker Docker image.

To run it:

cd caddy
docker-compose up

Then either navigate to https://foo.test or curl https://foo.test.

Note: the nginx/Caddy examples needs to be stopped before starting this Caddy example

Caddy Example with docker-gen

Caddy is the HTTP/2 web server with automatic HTTPS.

https://caddyserver.com/

This image leverages Docker-gen to "Generate files from docker container meta-data".

Which allows us to build the configuration for the reverse proxy using labels on the target container (without a Caddyfile, that's the file generated from the labels).

See ./caddy-gen, uses https://github.com/wemake-services/caddy-gen Docker image.

cd caddy-gen
docker-compose up

Then either navigate to https://foo.test or curl https://foo.test.

Note: the nginx/other Caddy examples needs to be stopped before starting the Caddy example

nginx Example

nginx is a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.

Wikipedia

See ./nginx, uses https://github.com/jwilder/nginx-proxy Docker image.

This image leverages Docker-gen to "Generate files from docker container meta-data".

cd nginx
docker-compose up

Then either navigate to https://foo.test or curl https://foo.test.

Note: the Caddy examples needs to be stopped before starting the nginx example

docker-compose-local-https's People

Contributors

hugodf 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.