Giter Club home page Giter Club logo

traefik-home's Introduction

ghcr.io release

Traefik Home

preview

This tool will create a homepage for quick access to the domains where containers are exposed via traefik proxy using v2 configuration. (for old v1 configuration see here)

Domains are automatically retrieved reading traefik labels and only http(s) routers are supported.

Why this tool

Traefik is a reverse proxy that reads label on the docker compose file and automatically set up itself, so that you can access a service on a container with the specified hostname. Even though Traefik provides a dashboard that allow you to see services that are proxied, you still have to remember (or save somewhere) all the hostnames in order to access your services. This tool creates a Home page where all hostnames all listed, for easy access.

It uses docker-gen to monitor docker configuration changes and render a web page that will be served using nginx This way changes are immediately reflected whenever something gets updated.

Usage

For a quick preview you can just run the image with the following docker run command:

docker run --name traefik-home \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    --label traefik.enable=true \
    --label traefik.http.routers.traefik-home.rule="Host(`home.example.com`)" \
    --label traefik.http.services.traefik-home.loadbalancer.server.port="80" \
    ghcr.io/santimar/traefik-home:latest

Wait for the service to be online, then go to home.example.com and enjoy the view.

For long runs however, the docker-compose file is a better approach.

Docker compose

version: '3'

services:
  traefik-home:
    image: ghcr.io/santimar/traefik-home:latest  # or use a specific tag version
    container_name: traefik-home
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      - traefik.enable="true"
      - traefik.http.routers.traefik-home.rule="Host(`home.example.com`)"
      - traefik.http.services.traefik-home.loadbalancer.server.port="80"

  other-service:
    image: ...
    labels:
      # see below for more info about exposed containers configuration
      - traefik-home.icon: "https://url/of/an/icon.png"
      - traefik-home.alias: "Alias"
    

Labels to configure Home

The traefik-home container can be configured using the following optional labels.

Label Description Default
traefik-home.show-footer Whether to show footer on the home page true
traefik-home.show-status-dot Whether to show green/red status dot near the container name true

Labels to configure containers

Home will use the following traefik labels to generate the HTML page.

Label Description
traefik.http.routers.<service>.rule Domain used by Home to generate the link to the service
traefik.http.routers.<service>.entrypoints Only web or websecure entrypoints are shown
traefik.home Only explicitly enabled container are shown on the homepage

On each exposed container, the following optional labels can be added to provide a personalized configuration.

Label Description
traefik-home.hide="true" Do not show this container in the home page
traefik-home.icon="https://url/of/icon" URL of an image that will be used as icon for the container. If this label is not used, a icon with the container's initials will be used
traefik-home.alias="alias" If used, the alias will be shown instead of the container name

Update

When a new release is available, just:

docker pull ghcr.io/santimar/traefik-home:latest

and then

docker-compose up -d traefik-home 

traefik-home's People

Contributors

dependabot[bot] avatar kerryholmes avatar santimar 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.