Skip to content

Instantly share code, notes, and snippets.

@eshnil2000
Created January 2, 2021 08:33
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 eshnil2000/af669ba8ec59c4bad6c25d5800e5f704 to your computer and use it in GitHub Desktop.
Save eshnil2000/af669ba8ec59c4bad6c25d5800e5f704 to your computer and use it in GitHub Desktop.
version: '3'
services:
traefik:
# The latest official supported Traefik docker image
image: traefik:v2.3
# Enables the Traefik Dashboard and tells Traefik to listen to docker
# enable --log.level=INFO so we can see what Traefik is doing in the log files
ports:
# Exposes port 80 for incomming web requests
- "80:80"
- "443:443"
# The Web UI port http://0.0.0.0:8080 (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
# Copies the Let's Encrypt certificate locally for ease of backing up
- ./letsencrypt:/letsencrypt
# Mounts the Traefik static configuration inside the Traefik container
- ./traefik.dns.yml:/etc/traefik/traefik.yml
environment:
- "NAMECOM_API_TOKEN=xxx"
- "NAMECOM_USERNAME=xxx"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.labs.dappsuni.com`)"
- "traefik.http.routers.traefik.service=traefik"
#- "traefik.http.services.traefik.loadbalancer.server.port=5000"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik-secure.entrypoints=websecure"
- "traefik.http.routers.traefik-secure.tls.certresolver=myresolver"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=labs.dappsuni.com"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.labs.dappsuni.com"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.labs.dappsuni.com`)"
- "traefik.http.routers.traefik-secure.service=traefik"
# Add the catapp service
catapp:
image: mikesir87/cats:1.0
labels:
- "traefik.enable=true"
- "traefik.http.routers.catapp.entrypoints=web"
- "traefik.http.routers.catapp.rule=Host(`y.labs.dappsuni.com`)"
- "traefik.http.routers.catapp.service=catapp"
- "traefik.http.services.catapp.loadbalancer.server.port=5000"
- "traefik.http.routers.catapp-secure.entrypoints=websecure"
- "traefik.http.routers.catapp-secure.rule=Host(`y.labs.dappsuni.com`)"
- "traefik.http.routers.catapp-secure.service=catapp"
- "traefik.http.routers.catapp-secure.tls=true"
#- "traefik.http.routers.catapp.tls.certresolver=myresolver"
# Add the catapp service
whoami:
image: jwilder/whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.rule=Host(`x.labs.dappsuni.com`)"
- "traefik.http.routers.whoami.service=whoami"
- "traefik.http.services.whoami.loadbalancer.server.port=8000"
- "traefik.http.routers.whoami-secure.entrypoints=websecure"
- "traefik.http.routers.whoami-secure.rule=Host(`x.labs.dappsuni.com`)"
- "traefik.http.routers.whoami-secure.service=whoami"
- "traefik.http.routers.whoami-secure.tls=true"
#- "traefik.http.routers.catapp.tls.certresolver=myresolver"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment