https://github.com/guilhermednt/router
Simple Traefik router. Good for local development.
https://github.com/guilhermednt/router
developer-tools development-environment docker docker-compose http reverse-proxy traefik
Last synced: 4 months ago
JSON representation
Simple Traefik router. Good for local development.
- Host: GitHub
- URL: https://github.com/guilhermednt/router
- Owner: guilhermednt
- Created: 2018-03-26T05:39:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-26T01:44:00.000Z (over 4 years ago)
- Last Synced: 2025-04-04T15:52:34.723Z (10 months ago)
- Topics: developer-tools, development-environment, docker, docker-compose, http, reverse-proxy, traefik
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# router
Simple Traefik router. Good for local development and simple deployments.
# Usage
## TLS
To configure Let's Encrypt we are usind DNS Challenge.
The included example uses DigitalOcean's API but you can check other providers [here](https://doc.traefik.io/traefik/https/acme/#providers)
Create a `.env` based on `.env.dist`.
## Using this router
### Configure the `web` network
You need to create a `web` network for containers that should be exposed by the router.
$ docker network create --driver bridge --subnet your:ipv6:subnet/124 --ipv6 web
### Start Router
Start the router itself with the following command:
$ docker-compose up -d
### Configure your services
Now you can configure your containers to use it. Here's an example:
```yaml
version: '3.5'
services:
my_service:
image: my/service
labels:
- traefik.enable=true
- traefik.http.routers.donato.rule=Host(`example.com`)
- traefik.http.routers.donato.tls=true
- traefik.http.routers.donato.tls.certResolver=lets-encrypt
- traefik.http.routers.donato.middlewares=secHeaders@file
- traefik.port=80
networks:
- web
networks:
web:
external: true
```
When you start the `my_service` container Traefik will automatically detect it and redirect all requests for `example.com` to the container.