diff --git a/ACME/acme.json b/ACME/acme.json new file mode 100644 index 0000000..e69de29 diff --git a/config/traefik.yml b/config/traefik.yml new file mode 100644 index 0000000..991a595 --- /dev/null +++ b/config/traefik.yml @@ -0,0 +1,268 @@ +################################################################ +# +# 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: false + +################################################################ +# EntryPoints configuration +################################################################ + +# EntryPoints definition +# +# Optional +# +entryPoints: + web: + address: :80 + + websecure: + address: :443 + +################################################################ +# Traefik logs configuration +################################################################ + +# Traefik logs +# Enabled by default and log to stdout +# +# Optional +# +log: + # Log level + # + # Optional + # Default: "ERROR" + # +# level: DEBUG + + # Sets the filepath for the traefik log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # + filePath: logs/traefik.log + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # +# format: json + +################################################################ +# Access logs configuration +################################################################ + +# Enable access logs +# By default it will write to stdout and produce logs in the textual +# Common Log Format (CLF), extended with additional fields. +# +# Optional +# +accessLog: + # Sets the file path for the access log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # + filePath: /logs/log.txt + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # +# format: json + +################################################################ +# API and dashboard configuration +################################################################ + +# Enable API and dashboard +# +# Optional +# +api: + # Enable the API in insecure mode + # + # Optional + # Default: false + # + insecure: true + + # Enabled Dashboard + # + # Optional + # Default: true + # +# dashboard: false + +################################################################ +# Ping configuration +################################################################ + +# Enable ping +#ping: + # Name of the related entry point + # + # Optional + # Default: "traefik" + # +# entryPoint: traefik + +################################################################ +# Docker configuration backend +################################################################ + +providers: + # Enable Docker configuration backend + docker: + # Docker server endpoint. Can be a tcp or a unix socket endpoint. + # + # Required + # Default: "unix:///var/run/docker.sock" + # +# endpoint: tcp://10.10.10.10:2375 + + # Default host rule. + # + # Optional + # Default: "Host(`{{ normalize .Name }}`)" + # +# defaultRule: Host(`{{ normalize .Name }}.docker.localhost`) + + # Expose containers by default in traefik + # + # Optional + # Default: true + # + exposedByDefault: false + + #Provider File +# file: +# watch: true +# filename: "/config/dynamic.yml" + +certificatesResolvers: + myresolver: + # Enable ACME (Let's Encrypt): automatic SSL. + acme: + + # Email address used for registration. + # + # Required + # + email: "ddns@mcseeno.de" + + # File or key used for certificates storage. + # + # Required + # + storage: "/ACME/acme.json" + + # CA server to use. + # Uncomment the line to use Let's Encrypt's staging server, + # leave commented to go to prod. + # + # Optional + # Default: "https://acme-v02.api.letsencrypt.org/directory" + # + caServer: "https://acme-staging-v02.api.letsencrypt.org/directory" + + # The certificates' duration in hours. + # It defaults to 2160 (90 days) to follow Let's Encrypt certificates' duration. + # + # Optional + # Default: 2160 + # + # certificatesDuration: 2160 + + # Preferred chain to use. + # + # If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name. + # If no match, the default offered chain will be used. + # + # Optional + # Default: "" + # + # preferredChain: 'ISRG Root X1' + + # KeyType to use. + # + # Optional + # Default: "RSA4096" + # + # Available values : "EC256", "EC384", "RSA2048", "RSA4096", "RSA8192" + # + # keyType: RSA4096 + + # Use a TLS-ALPN-01 ACME challenge. + # + # Optional (but recommended) + # + tlsChallenge: + + # Use a HTTP-01 ACME challenge. + # + # Optional + # + httpChallenge: + + # EntryPoint to use for the HTTP-01 challenges. + # + # Required + # + entryPoint: web + + # Use a DNS-01 ACME challenge rather than HTTP-01 challenge. + # Note: mandatory for wildcard certificate generation. + # + # Optional + # + # dnsChallenge: + + # DNS provider used. + # + # Required + # + # provider: digitalocean + + # By default, the provider will verify the TXT DNS challenge record before letting ACME verify. + # If delayBeforeCheck is greater than zero, this check is delayed for the configured duration in seconds. + # Useful if internal networks block external DNS queries. + # + # Optional + # Default: 0 + # + # delayBeforeCheck: 0 + + # Use following DNS servers to resolve the FQDN authority. + # + # Optional + # Default: empty + # + # resolvers + # - "1.1.1.1:53" + # - "8.8.8.8:53" + + # Disable the DNS propagation checks before notifying ACME that the DNS challenge is ready. + # + # NOT RECOMMENDED: + # Increase the risk of reaching Let's Encrypt's rate limits. + # + # Optional + # Default: false + # + # disablePropagationCheck: true \ No newline at end of file diff --git a/docker-compose.traefik3.yml b/docker-compose.traefik3.yml index b35b817..b8c618d 100644 --- a/docker-compose.traefik3.yml +++ b/docker-compose.traefik3.yml @@ -5,12 +5,17 @@ services: # The official v3 Traefik docker image image: traefik:v3.1 # Enables the web UI and tells Traefik to listen to docker - command: --api.insecure=true --providers.docker + command: --configFile=/config/traefik.yml ports: # The HTTP port - "80:80" + # The HTTPS port + - "443:443" # The Web UI (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 \ No newline at end of file + - /var/run/docker.sock:/var/run/docker.sock + - /docker/traefik3/logs:/logs + - /docker/traefik3/config:/config + - /docker/traefik3/ACME/acme.json:/ACME/acme.json \ No newline at end of file diff --git a/logs/README.md b/logs/README.md new file mode 100644 index 0000000..d2439ac --- /dev/null +++ b/logs/README.md @@ -0,0 +1,2 @@ +# traefik3 + diff --git a/traefik.sample.yml b/traefik.sample.yml new file mode 100644 index 0000000..c13ebcd --- /dev/null +++ b/traefik.sample.yml @@ -0,0 +1,151 @@ +################################################################ +# +# 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: + web: + address: :80 + + websecure: + address: :443 + +################################################################ +# Traefik logs configuration +################################################################ + +# Traefik logs +# Enabled by default and log to stdout +# +# Optional +# +#log: + # Log level + # + # Optional + # Default: "ERROR" + # +# level: DEBUG + + # Sets the filepath for the traefik log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # +# filePath: log/traefik.log + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # +# format: json + +################################################################ +# Access logs configuration +################################################################ + +# Enable access logs +# By default it will write to stdout and produce logs in the textual +# Common Log Format (CLF), extended with additional fields. +# +# Optional +# +#accessLog: + # Sets the file path for the access log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # +# filePath: /path/to/log/log.txt + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # +# format: json + +################################################################ +# API and dashboard configuration +################################################################ + +# Enable API and dashboard +# +# Optional +# +#api: + # Enable the API in insecure mode + # + # Optional + # Default: false + # +# insecure: true + + # Enabled Dashboard + # + # Optional + # Default: true + # +# dashboard: false + +################################################################ +# Ping configuration +################################################################ + +# Enable ping +#ping: + # Name of the related entry point + # + # Optional + # Default: "traefik" + # +# entryPoint: traefik + +################################################################ +# Docker configuration backend +################################################################ + +#providers: + # Enable Docker configuration backend +# docker: + # Docker server endpoint. Can be a tcp or a unix socket endpoint. + # + # Required + # Default: "unix:///var/run/docker.sock" + # +# endpoint: tcp://10.10.10.10:2375 + + # Default host rule. + # + # Optional + # Default: "Host(`{{ normalize .Name }}`)" + # +# defaultRule: Host(`{{ normalize .Name }}.docker.localhost`) + + # Expose containers by default in traefik + # + # Optional + # Default: true + # +# exposedByDefault: false