Deployment of Traefik using docker-compose
Go to file
Kris Lamoureux db3b3e332b
Move the HTTPS version to docker-compose.https.yml
This is part of a bigger move to put nginx in front of Traefik instances
2024-04-19 22:21:02 -04:00
docker-compose.https.yml Move the HTTPS version to docker-compose.https.yml 2024-04-19 22:21:02 -04:00
docker-compose.web.yml Use non-standard port for WEB_PORT in web compose 2023-11-26 16:44:36 -05:00
LICENSE Add basic Traefik docker-compose.yml file 2023-10-09 23:42:46 -04:00
README.md Remove unused variable 2023-10-10 00:17:19 -04:00

Traefik Deployment Repository

Traefik is excellent as a reverse proxy within Docker environments, boasting features like automatic service discovery and automated HTTPS via Let's Encrypt. While similar, the docker-compose files available here cater to different use cases for deploying Traefik.

Add services to Traefik

  1. Define the external traefik network on the top-level networks key
networks:
  traefik:
    external: true
  1. Attach your web container to Traefik's network via the service-level networks key
    networks:
      - traefik
  1. Define routing for Traefik in labels, replacing "examplerouter" with something unique
    labels:
      traefik.http.routers.examplerouter.rule: Host(`www.example.org`)
      traefik.http.routers.examplerouter.entrypoints: websecure
      traefik.http.routers.examplerouter.tls: true
      traefik.http.services.examplerouter.loadbalancer.server.port: 80
      traefik.docker.network: traefik

Variables

Here's a brief explanation of the variables used in the docker-compose files:

Docker Settings

  • IMAGE: The name of the Docker image (default: traefik).
  • VERSION: The tag of the Docker image (default: latest).
  • NAME: The name assigned to the created container (default: traefik).

Traefik Settings

  • DASHBOARD: Enable(=true) or disable(=false) the Traefik API dashboard (default: true).
  • DOMAIN: The domain name where Traefik's dashboard is accessible (default: traefik.local.krislamo.org).
  • ENTRYPOINT: The entry point for the dashboard (default: local).
  • EXPOSED_BY_DEFAULT: Expose Docker containers by default without needing specific labels (default: false).

Network Settings

  • NETWORK: The Docker network to be used (default: traefik).
  • WEB_PORT: Binding for the regular HTTP traffic (default: 0.0.0.0:80:80).
  • WEBSECURE_PORT: Binding for HTTPS traffic (default: 0.0.0.0:443:443).
  • LOCAL_PORT: Binding for local HTTPS traffic (default: 127.0.0.1:8443:8443).

Other Settings

  • ENABLE: Enable(=true) or disable(=false) Traefik to expose its API and dashboard (default: false).
  • LOG_LEVEL: Logging level (default: ERROR).
  • DEBUG: Enable(=true) or turn off(=false) API debugging (default: false).

License

This project is released under the 0BSD license, which allows for unrestricted use, modification, and distribution.