From 8cdcac64033e264500cf71b57d488e55047a19c7 Mon Sep 17 00:00:00 2001 From: Simon Einzinger Date: Mon, 23 Dec 2024 20:14:54 +0100 Subject: [PATCH] Initial commit --- .gitignore | 3 + docker-compose.yml | 31 +++++++++ traefik.yaml | 165 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 traefik.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81713a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +letsencrypt +log +override.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..acf7ca0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +networks: + dockersock: + proxy: + external: true + +services: + dockerproxy: + environment: + CONTAINERS: 1 + image: tecnativa/docker-socket-proxy + networks: + - dockersock + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + + traefik: + depends_on: + - dockerproxy + image: traefik:v3.2 + container_name: traefik + networks: + - dockersock + - proxy + ports: + - "80:80" + - "443:443" + restart: always + volumes: + - ./traefik.yaml:/etc/traefik/traefik.yaml:ro + - ./letsencrypt:/var/letsencrypt + - ./log:/log diff --git a/traefik.yaml b/traefik.yaml new file mode 100644 index 0000000..2b1174c --- /dev/null +++ b/traefik.yaml @@ -0,0 +1,165 @@ +################################################################ +# +# 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" + +certificatesResolvers: + resolver: + acme: + email: info@simon-einzinger.de + storage: /var/letsencrypt/acme.json + httpChallenge: + entryPoint: web + +################################################################ +# Traefik logs configuration +################################################################ + +# Traefik logs +# Enabled by default and log to stdout +# +# Optional +# +log: + # Log level + # + # Optional + # Default: "ERROR" + # + level: INFO + + # 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 + + maxBackups: 3 + + maxAge: 14 + + + +################################################################ +# 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: true + +################################################################ +# 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://dockerproxy: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