From 35e640e6d6939aa1c4dfdfae6dc4e25ec4ee9364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Uruba?= Date: Fri, 1 Sep 2023 20:32:40 +0200 Subject: [PATCH] initial commit - traefik service definition --- .env.sample | 1 + certs/.gitkeep | 0 conf/traefik.toml | 161 +++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 30 +++++++++ 4 files changed, 192 insertions(+) create mode 100644 .env.sample create mode 100644 certs/.gitkeep create mode 100755 conf/traefik.toml create mode 100755 docker-compose.yml diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..c53f9dd --- /dev/null +++ b/.env.sample @@ -0,0 +1 @@ +NETWORK_NAME= diff --git a/certs/.gitkeep b/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/traefik.toml b/conf/traefik.toml new file mode 100755 index 0000000..401a4dd --- /dev/null +++ b/conf/traefik.toml @@ -0,0 +1,161 @@ +################################################################ +# Global configuration +################################################################ + +# Enable debug mode +# +# Optional +# Default: false +# +# debug = true + +# Log level +# +# Optional +# Default: "ERROR" +# +# logLevel = "DEBUG" + +# Entrypoints to be used by frontends that do not specify any entrypoint. +# Each frontend can specify its own entrypoints. +# +# Optional +# Default: ["http"] +# +# defaultEntryPoints = ["http", "https"] + +################################################################ +# Entrypoints configuration +################################################################ + +# Entrypoints definition +# +# Optional +# Default: +[entryPoints] + [entryPoints.web] + address = ":80" + + [entryPoints.websecure] + address = ":443" + +################################################################ +# Traefik logs configuration +################################################################ + +# Traefik logs +# Enabled by default and log to stdout +# +# Optional +# +# [traefikLog] + +# 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 = "common" + +################################################################ +# 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 = "common" + +################################################################ +# API and dashboard configuration +################################################################ + +# Enable API and dashboard +[api] + + # Name of the related entry point + # + # Optional + # Default: "traefik" + # + # entryPoint = "traefik" + + # Enabled Dashboard + # + # Optional + # Default: true + # + #dashboard = true + + insecure=true + +################################################################ +# Ping configuration +################################################################ + +# Enable ping +[ping] + + # Name of the related entry point + # + # Optional + # Default: "traefik" + # + # entryPoint = "traefik" + +################################################################ +# Docker configuration backend +################################################################ + +# 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 domain used. +# Can be overridden by setting the "traefik.domain" label on a container. +# +# Optional +# Default: "" +# +# domain = "docker.localhost" + +# Expose containers by default in traefik +# +# Optional +# Default: true +# +# exposedByDefault = true + +[providers.docker] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..2d0729e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,30 @@ +version: '3' + +services: + reverse-proxy: + # The official v2 Traefik docker image + image: traefik:v2.10 + # Enables the web UI and tells Traefik to listen to docker + command: + - "--api.insecure=true" + - "--providers.docker=true" + 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:ro + - ./conf/traefik.toml:/etc/traefik/traefik.toml:ro + - ./certs:/etc/certs:ro + networks: + - public + +networks: + public: + external: true + name: ${NETWORK_NAME} +