Skip to content

devgine/traefik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stack

About

This repository contains a traefik reverse proxy and a docker image to generate self-signed certificate for development projects.

Requirements

How to ?

Clone the project

git clone git@github.com:devgine/stack.git

Setup

Using Taskfile

task up

Using Makefile

make up

Visit traefik dashboard to make sure the installation is successfully done https://dashboard.traefik.localhost
Or by visiting the api https://dashboard.traefik.localhost/api/rawdata

Important To use the traefik certificatem your local domain must be a subdomain of traefik.localhost
For example : my_project.traefik.localhost

Help

Run the following command to show all available jobs Using Taskfile

task

Using Makefile

make

How to use services with traefik

Below is an example of using the nginx service with traefik

After running the nginx container, the service should be accessible by visiting https://nginx.traefik.localhost

services:
  nginx:
    container_name: nginx
    image: nginx:latest
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik-network
      - traefik.http.routers.nginx-https.rule=Host(`nginx.traefik.localhost`)
      - traefik.http.routers.nginx-https.entrypoints=websecure
      - traefik.http.routers.nginx-https.tls=true
      - traefik.http.services.nginx-loadbalancer.loadbalancer.server.port=80
    networks:
      - traefik-network

networks:
  traefik-network:
    external: true

Chrome trust insecure localhost

Open Chrome browser and visit the below URL then allow invalid certificates for resources loaded from localhost.

chrome://flags/#allow-insecure-localhost