First draft of working 2.0 traefik
This commit is contained in:
parent
eb1a2ee38c
commit
c1197a4fba
|
|
@ -1,45 +1,36 @@
|
|||
version: '3'
|
||||
# Create 3 node-red docker containers ready to operate behind traefik Reverse proxy
|
||||
|
||||
services:
|
||||
nodered1: #Nodered Docker container 1
|
||||
image: nodered/node-red-docker:latest
|
||||
restart: always
|
||||
user: root
|
||||
environment:
|
||||
- TZ= America/New_York
|
||||
networks:
|
||||
- web
|
||||
volumes:
|
||||
- /home/simon/docker/noder_data/:/data # Do nor forget to set NR volumes
|
||||
ports:
|
||||
- "1882:1880"
|
||||
whoami:
|
||||
# A container that exposes an API to show its IP address
|
||||
image: containous/whoami
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.backend=nodered1"
|
||||
- "traefik.docker.network=web"
|
||||
- "traefik.frontend.rule=Host:node.docker.localhost"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web"
|
||||
|
||||
whoami:
|
||||
image: emilevauge/whoami
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- "traefik.frontend.rule=Host:whoami.docker.localhost"
|
||||
|
||||
traefix: # Traefix docker compose start here
|
||||
image: traefik:alpine
|
||||
# command: --api --docker
|
||||
restart: always
|
||||
reverse-proxy:
|
||||
# The official v2.0 Traefik docker image
|
||||
image: traefik:v2.0
|
||||
container_name: "traefik"
|
||||
command:
|
||||
- "--log.level=DEBUG"
|
||||
- "--api.insecure=true"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--entrypoints.web.address=:80"
|
||||
ports:
|
||||
# The HTTP port
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
#- "8080:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- /docker/traefik:/etc/traefik
|
||||
networks:
|
||||
- web
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
# So that Traefik can listen to the Docker events
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./traefik.yml:/etc/traefik/traefik.yml
|
||||
- ./static_config.yml:/etc/traefik/static_config.yml
|
||||
labels:
|
||||
- "traefik.http.routers.traefik.rule=Host(`tr.localhost`)"
|
||||
- "traefik.http.routers.traefik.entrypoints=web"
|
||||
- "traefik.http.services.service1.loadbalancer.server.port=8080"
|
||||
- "traefik.enable=true"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
http:
|
||||
routers:
|
||||
test-router:
|
||||
rule: "Host(`test.localhost`)"
|
||||
service: my-service
|
||||
entryPoints:
|
||||
- web
|
||||
|
||||
services:
|
||||
my-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: https://milvert.com
|
||||
|
||||
15
traefik.toml
15
traefik.toml
|
|
@ -1,15 +0,0 @@
|
|||
logLevel = "DEBUG"
|
||||
defaultEntryPoints = ["http"]
|
||||
|
||||
[api]
|
||||
# Port for the status/dashboard page
|
||||
dashboard = true
|
||||
|
||||
[entryPoints]
|
||||
[entryPoints.http]
|
||||
address = ":80"
|
||||
|
||||
[docker]
|
||||
endpoint = "unix:///var/run/docker.sock"
|
||||
domain = "docker.localhost"
|
||||
exposedByDefault = false
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
log:
|
||||
level: DEBUG
|
||||
|
||||
api:
|
||||
insecure: true
|
||||
dashboard: true
|
||||
debug: true
|
||||
|
||||
|
||||
providers:
|
||||
docker:
|
||||
exposedbydefault: false
|
||||
|
||||
file:
|
||||
filename: "/etc/traefik/static_config.yml"
|
||||
watch: true
|
||||
|
||||
|
||||
|
||||
|
||||
entryPoints:
|
||||
web:
|
||||
address: ":80"
|
||||
Loading…
Reference in New Issue