All Projects → Starttoaster → Docker Traefik

Starttoaster / Docker Traefik

Licence: mit
Script to setup Traefik reverse-proxy in Docker with Compose

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Docker Traefik

Docker Continuous Deployment
continuous deployment of a microservices application with Docker
Stars: ✭ 141 (-7.84%)
Mutual labels:  docker-compose
Bmw Labeltool Lite
This repository provides you with a easy to use labeling tool for State-of-the-art Deep Learning training purposes.
Stars: ✭ 145 (-5.23%)
Mutual labels:  docker-compose
Django Celery Docker Example
Example Docker setup for a Django app behind an Nginx proxy with Celery workers
Stars: ✭ 149 (-2.61%)
Mutual labels:  docker-compose
Web Methodology
Methodology for high-quality web application security testing - https://github.com/tprynn/web-methodology/wiki
Stars: ✭ 142 (-7.19%)
Mutual labels:  web-application
Docker Rabbitmq Cluster
Cluster RabbitMQ (official docker image)
Stars: ✭ 144 (-5.88%)
Mutual labels:  docker-compose
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-3.92%)
Mutual labels:  docker-compose
Go Oauth2 Server
A standalone, specification-compliant, OAuth2 server written in Golang.
Stars: ✭ 1,843 (+1104.58%)
Mutual labels:  docker-compose
Infrastructure As Code Tutorial
Infrastructure As Code Tutorial. Covers Packer, Terraform, Ansible, Vagrant, Docker, Docker Compose, Kubernetes
Stars: ✭ 1,954 (+1177.12%)
Mutual labels:  docker-compose
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+1092.81%)
Mutual labels:  reverse-proxy
Docker Wordpress
WordPress container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux
Stars: ✭ 148 (-3.27%)
Mutual labels:  docker-compose
Django React Typescript
A boilerplate with Django on the backend, React on the frontend, and much more!
Stars: ✭ 142 (-7.19%)
Mutual labels:  docker-compose
Practical Dapr
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 140 (-8.5%)
Mutual labels:  docker-compose
Commafeed
Google Reader inspired self-hosted RSS reader.
Stars: ✭ 1,842 (+1103.92%)
Mutual labels:  web-application
Spring
Spring integration for Vaadin
Stars: ✭ 141 (-7.84%)
Mutual labels:  web-application
Container
HedgeDoc container image resources
Stars: ✭ 149 (-2.61%)
Mutual labels:  docker-compose
Docker Portainer Letsencrypt
Portainer docker container over SSL Certificate using Let's Encrypt automated by our webproxy docker-compose-letsencrypt-nginx-proxy
Stars: ✭ 141 (-7.84%)
Mutual labels:  docker-compose
Coroute
Node HTTP reverse-proxy server
Stars: ✭ 147 (-3.92%)
Mutual labels:  reverse-proxy
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+0%)
Mutual labels:  docker-compose
Docker Stack This
A Docker Stack that just work. With Traefik, Socat, Portainer, Nginx, Caddy, Whoami
Stars: ✭ 149 (-2.61%)
Mutual labels:  reverse-proxy
Media Docker
all-in-one deployment and configuration for an all-in-one media server, running on docker.
Stars: ✭ 148 (-3.27%)
Mutual labels:  docker-compose

Traefik Reverse-Proxy

This script configures a Traefik reverse proxy with LetsEncrypt certs for your public webapps. In my example, I set up a DokuWiki (excellent plain text with markdown wiki app.) While doing this I felt there was no really simple guide to achieve this result, and may be a little confusing for other people, so here you go.

NOTE: This currently works with Traefik v1. Support for v2 to come soon.

Domain Registry + DNS Configuration

I purchased my domain through NameCheap. Whatever domain registrar you go through, you're going to need to set up DNS records properly through them. I recommend NameCheap because of how simple it was, but they are all about the same. As long as the provider allows wildcard DNS records you should be good to go. In Namecheap's "Advanced DNS" tab I only added this, change the IP-ADDRESS value to your server's public IP address:

Type Host Value TTL
A Record * IP-ADDRESS Automatic

Installation

  1. Clone the repo: git clone https://github.com/Starttoaster/docker-traefik.git

  2. Change directory: cd docker-traefik

  3. Run the script: ./docker-traefik.sh

  4. Change directory: cd /opt/traefik

Once you answer a couple questions, the script should complete. If you are running on a VPS (cloud server) you should then be ready to run docker-compose up -d and bring up your apps. If you are self-hosting from home, then move on to the next sections for home networks. If you want to add more or other apps to the docker-compose file, you simply need to add the labels section to each service and just change the subdomain to what you want its URL to be.

For home networks and servers using private IP addresses

If you've done this guide on a server using a private IP address (behind some kind of router), make sure to also open up your router's configuration page and forward ports 80 and 443 to your server's private IP address. I cannot instruct on how to do this as each router has different configuration pages, but just search Google for your router + "port forwarding". While you're here, also make sure your server has a statically assigned private IP. This will save a great deal of headache if your server ever gets rebooted and assigned a new IP from your DHCP pool.

Home networks extra credit: Dynamic DNS

Setting up dynamic DNS is entirely optional. Internet service providers do not typically assign static public IP addresses to residential home users. You may find one day that your cable modem/router was reset for some reason. After the modem/router came back online, it was potentially assigned a new public IP address by your ISP's DHCP. In this instance you have two options:

  1. Manually find your new public IP address, (Go to: https://diagnostic.opendns.com/myip), and change the IP-ADDRESS sections to match your new IP address on your DNS A Records with whoever your DNS provider is. Mine being Namecheap's Basic DNS.

  2. Set up Dynamic DNS (DDNS). DDNS runs a minimal web application from within your home server that periodically sends an update of what IP address you're currently using to your DNS provider. It authenticates to the DNS provider via a passkey(s) that is assigned by the DNS provider, and if your IP address ever changes the DNS provider will update their A Records automatically. I recommend following the setup instructions here: https://github.com/qdm12/ddns-updater

The container supports Namecheap, Cloudflare, GoDaddy, DuckDNS, and Dreamhost. Ensure that you have all the necessary parameters for when the script asks for them by following the instructions with the container owner. If setting up Cloudflare, please see my gist on Cloudflare API calls here.

Traefik Dashboard

This is entirely optional. The Traefik dashboard offers some information about the applications behind your web proxy. I have added a conditional that allows you to automate the configuration of the web dashboard. You will need an 'htpasswd' which I have included a section below on how to obtain one. An htpasswd is just a username with a hashed password. See 'To generate an htpasswd' below. When the Traefik dashboard is configured, you will just need to enter your username and password in the dialog box that pops up at https://dash.YOUR-DOMAIN.TLD

HTTP Basic Auth

This is entirely optional. If you would like all of your apps to have an additional layer of protection then you can configure an htpasswd in the traefik.toml file. An htpasswd is just a username with a hashed password. I have added a conditional in the script that will configure this for you. All you need is an "htpasswd" to enter when the script asks for it. When you want to visit one of your webapps, you will need to enter the username and password you chose in the dialog box that pops up.

To generate an htpasswd, either:

  1. Install the 'apache2-utils' package on your linux distro, and run: htpasswd -nb user password

Making sure to replace user with the desired username, and password with the desired password; or

  1. Visit: http://www.htaccesstools.com/htpasswd-generator/

Simply enter your desired username and password, then copy that string and enter it in the script when asked for it.

Special Thanks

To GitHub user qdm12 for their lightweight Dynamic DNS updating docker image. qdm12/ddns-updater

To GitHub user szepeviktor for their contributions to this script.

To Miroslav Prasil for the best DokuWiki docker image on Docker Hub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].