From 2575b1923905ed3d8a321b8ffd35b9fc6ba580cc Mon Sep 17 00:00:00 2001 From: PAPAMICA Date: Thu, 21 Apr 2022 10:45:09 +0200 Subject: [PATCH] add traefik --- templates-portainer.json | 35 ++++++++++++++++++++++++++++++++ traefik.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 traefik.yml diff --git a/templates-portainer.json b/templates-portainer.json index 45af348..12cfe59 100644 --- a/templates-portainer.json +++ b/templates-portainer.json @@ -17,6 +17,41 @@ "container": "/var/lib/registry" }] }, + { + "type": 3, + "title": "Traefik", + "description": "Reverse proxy", + "note": "

Site de l'application : traefik.io<\/a>", + "categories": [ + "SelfHosting", + "PAPAMICA" + ], + "platform": "linux", + "logo": "https://styles.redditmedia.com/t5_fucxb/styles/communityIcon_dr8ojdk0l2d51.png", + "repository": { + "url": "https://github.com/PAPAMICA/docker-compose-collection", + "stackfile": "traefik.yml" + }, + "env": [{ + "name": "SERVICE", + "label": "Nom du service" + }, + { + "name": "DATA_LOCATION", + "label": "Localisation des données", + "description": "exemple /_data/apps" + }, + { + "name": "ADMIN", + "label": "Utilisateur et mot de passe admin (voir documentation)", + "description": "exemple PAPAMICA:{SHA}XXXXXxxxxxXXXXxxX=" + }, + { + "name": "URL", + "label": "Lien du dashboard complet", + "description": "exemple : traefik.papamica.com" + }] + }, { "type": 3, diff --git a/traefik.yml b/traefik.yml new file mode 100644 index 0000000..96cb417 --- /dev/null +++ b/traefik.yml @@ -0,0 +1,44 @@ +# Docker-compose mis à disposition par Mickael "PAPAMICA" Asseline +# Date de mise à jour : 21/05/2022 + +# Variables d'environnement à déclarer : +# - SERVICE : nom du service (exemple : plex) +# - DATA_LOCATION : localisation des données (exemple /apps/"service") +# - URL : Site web du service (exemple : url.papamica.fr) +# - ADMIN : ADMIN_USER:ADMIN_PASSWORD + +# Fonctionne avec Portainer +version: "3.3" +services: + traefik: + image: traefik:latest + container_name: $SERVICE + restart: always + healthcheck: + test: grep -qr "traefik" /proc/*/status || exit 1 + interval: 1m + timeout: 30s + retries: 3 + ports: + - 80:80 + - 443:443 + volumes: + - /etc/localtime:/etc/localtime:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + - $DATA_LOCATION/traefik/config/traefik.yml:/traefik.yml:ro + - $DATA_LOCATION/traefik/config/config.yml:/config.yml:ro + - $DATA_LOCATION/traefik/config/acme.json:/acme.json + labels: + traefik.enable: true + traefik.http.routers.api.entrypoints: https + traefik.http.routers.api.rule: Host(`$URL`) + traefik.http.routers.api.service: api@internal + traefik.http.routers.api.middlewares: auth + traefik.http.middlewares.auth.basicauth.users: $ADMIN + networks: + - proxy + +networks: + proxy: + external: + name: proxy \ No newline at end of file