Skip to content

Instantly share code, notes, and snippets.

@lmeyer
Created January 24, 2022 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmeyer/dad3b4ad186fe8c76da009b1a5492dad to your computer and use it in GitHub Desktop.
Save lmeyer/dad3b4ad186fe8c76da009b1a5492dad to your computer and use it in GitHub Desktop.
Traefik config
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.5
restart: always
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
- "8084:8084"
volumes:
# So that Traefik can listen to the Docker events
- //var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml

In WSL

$ cd ~
$ mkdir traefik
$ cd traefik
$ git clone git@gist.github.com:3b0d1a6900cc15825ddfdc3d1b040753.git .
$ docker-compose up -d
################################################################
#
# Configuration sample for Traefik v2.
#
# For Traefik v1: https://github.com/traefik/traefik/blob/v1.7/traefik.sample.toml
#
################################################################
################################################################
# Global configuration
################################################################
global:
checkNewVersion: true
sendAnonymousUsage: true
################################################################
# EntryPoints configuration
################################################################
# EntryPoints definition
#
# Optional
#
entryPoints:
http:
address: :80
webpack:
address: :8084
# mysql:
# address: :3306
api:
insecure: true
dashboard: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
defaultRule: Host(`{{ index .Labels "com.docker.compose.project" }}.localhost`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment