Test to get traefik running

This commit is contained in:
Luke Else 2023-08-07 18:47:49 +01:00
parent 86bb3d49d6
commit f66d90eef7

View File

@ -1,65 +1,29 @@
version: '3.8'
version: "3.8"
services:
#traefik (80, 443, 8080)
traefik:
image: 'traefik:latest'
container_name: traefik
volumes:
- ./letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
- ./dynamic.yaml:/dynamic.yaml
networks:
## Traefik is sat on every network to allow exposure ##
- traefik
- frontend
- development
- backend
- bitwarden
- services
ports:
## These ports are in format <host-port>:<container-port> ##
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '8080:8080' # Dashboard Port
image: "traefik:latest"
container_name: "traefik"
command:
## General Settings ##
- --api.insecure=true
- --api.dashboard=true
- --api.debug=true
## Log Settings ##
- --log.level=DEBUG # <== Setting the level of the logs from traefik
## Provider Settings ##
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/dynamic.yaml
## Entrypoints Settings ##
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
## Certificate Settings ##
- --certificatesresolvers.mytlschallenge.acme.tlschallenge=true
- --certificatesresolvers.mytlschallenge.acme.email=contact@luke-else.co.uk
- --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=contact@luke-else.co.uk"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
labels:
## Exposing API Dashboard Service ##
- traefik.enable=true
- traefik.http.routers.api.rule=Host("traefik.luke-else.co.uk")
- traefik.http.routers.api.service=api@internal
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.luke-else.co.uk`)"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
# - "traefik.http.routers.traefik.middlewares=traefik-auth"
# - "traefik.http.middlewares.traefik-auth.basicauth.users=user:$$2y$$05$$6m8MvyzgJ4Kl7/3rL4X6VurX1huMas8a7oPB3xRfBjFbGCR8MUi7W"
restart: unless-stopped
## All Networks for child containers - All containers depend on this container being spun up ##
networks:
traefik:
name: traefik
frontend:
name: frontend
development:
name: development
backend:
name: backend
bitwarden:
name: bitwarden
services:
name: services