Code Monkey home page Code Monkey logo

example-traefik-proxy-auto-ssl's Introduction

oanhnn/example-traefik-proxy-auto-ssl

An example for setting auto proxy and auto setup SSL with Traefik 2

Refs

Requirements

  • Docker Engine 17.12.0+
  • Docker Compose 1.18.0+

Usage

  • Clone this project and set environment variables by .env file (see .env.example file).

  • Create docker network for reverse proxy

    $ docker network create --driver=overlay reverse-proxy
  • Update docker node label if you run with Docker Swarm mode

    docker node update --label-add node-has-traefik-service=true $(docker info -f '{{.Swarm.NodeID}}') > /dev/null
  • Launch the traefik-proxy stack
    With docker-compose

    $ docker-compose -f docker-compose/traefik.yml up -d

    With Docker Swarm mode

    $ set -a; source .env; set +a; docker stack deploy -c docker-swarm/traefik.yml

    NOTE Docker dosen't load .env file. So that you load it by add set -a; source .env; set +a; before docker command

  • Create example service in reverse-proxy docker network like whoami service
    With docker-compose

    $ docker-compose -f docker-compose/whoami.yml up -d

    With Docker Swarm mode

    set -a; source .env; set +a; docker stack deploy -c docker-swarm/whoami.yml
  • Now your service was lauch and proxy with SSL.

    $ curl -H "Host: app.example.com" https://127.0.0.1/
  • Traefik dashboard was lauch in URL https://traefik.example.com/dashboard and secured with basic authentication and whilelist IP

NOTE You can use setup.sh script in docker-compose and docker-swarm for easier

Contributing

All code contributions must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send a pull request.

If you would like to help take a look at the list of issues.

License

This project is released under the MIT License.
Copyright © 2021 Oanh Nguyen
Please see License File for more information.

example-traefik-proxy-auto-ssl's People

Contributors

oanhnn avatar

Stargazers

 avatar  avatar

Watchers

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