From 4cb2462dfb5a4a4d437ec4de45462b122b6c1f50 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Thu, 25 Aug 2022 09:30:44 +0200 Subject: [PATCH] wip: traefik api --- docker-compose.dev.yml | 22 +++++++++++++++++++++- docker-compose.rc.yml | 2 +- docker-compose.yml | 2 +- traefik/dynamic.yml | 26 ++++++++++++++------------ traefik/traefik.yml | 12 ++++++------ 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index ecd9e989..ff8003e8 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,6 +1,20 @@ version: "3.7" services: + reverse-proxy: + container_name: reverse-proxy + image: traefik:v2.8 + restart: always + ports: + - ${NGINX_PORT-80}:80 + - ${PROXY_PORT-8080}:8080 + command: --api.insecure=true --providers.docker + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - ${PWD}/traefik:/root/.config + networks: + - tipi_main_network + tipi-db: container_name: tipi-db image: postgres:latest @@ -53,6 +67,12 @@ services: APPS_REPO_URL: ${APPS_REPO_URL} networks: - tipi_main_network + # labels: + # traefik.enable: true + # traefik.http.routers.api.rule: PathPrefix("/api") # Host(`tipi.local`) && + # traefik.http.routers.api.entrypoints: webinsecure + # traefik.http.routers.api.service: api + # traefik.http.services.api.loadbalancer.server.port: 3001 dashboard: build: @@ -73,7 +93,7 @@ services: labels: traefik.enable: true traefik.http.routers.dashboard.rule: PathPrefix("/") # Host(`tipi.local`) && - traefik.http.routers.dashboard.entrypoints: webinsecure + traefik.http.routers.dashboard.entrypoints: web traefik.http.routers.dashboard.service: dashboard traefik.http.services.dashboard.loadbalancer.server.port: 3000 diff --git a/docker-compose.rc.yml b/docker-compose.rc.yml index 019fadfb..2bb2cae0 100644 --- a/docker-compose.rc.yml +++ b/docker-compose.rc.yml @@ -3,7 +3,7 @@ version: "3.7" services: reverse-proxy: container_name: reverse-proxy - image: traefik:v2.6 + image: traefik:v2.8 restart: always ports: - ${NGINX_PORT-80}:80 diff --git a/docker-compose.yml b/docker-compose.yml index 34b91691..c1061cc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: "3.9" services: reverse-proxy: container_name: reverse-proxy - image: traefik:v2.6 + image: traefik:v2.8 restart: always ports: - ${NGINX_PORT-80}:80 diff --git a/traefik/dynamic.yml b/traefik/dynamic.yml index 59aab670..ba40118d 100644 --- a/traefik/dynamic.yml +++ b/traefik/dynamic.yml @@ -1,14 +1,16 @@ http: routers: - traefik: - rule: "Host(`proxy.tipi.local`)" - service: "api@internal" - tls: - domains: - - main: "tipi.local" - sans: - - "*.tipi.local" -tls: - certificates: - - certFile: "/root/.config/ssl/local-cert.pem" - keyFile: "/root/.config/ssl/local-key.pem" \ No newline at end of file + dashboard: + rule: PathPrefix(`/`) + service: dashboard + + services: + dashboard: + loadBalancer: + servers: + - port: 3000 + +# tls: +# certificates: +# - certFile: "/root/.config/ssl/local-cert.pem" +# keyFile: "/root/.config/ssl/local-key.pem" \ No newline at end of file diff --git a/traefik/traefik.yml b/traefik/traefik.yml index d1c70517..c7989768 100644 --- a/traefik/traefik.yml +++ b/traefik/traefik.yml @@ -1,6 +1,6 @@ -api: - dashboard: true - insecure: true +# api: +# dashboard: true +# insecure: true providers: docker: @@ -14,7 +14,7 @@ providers: # watch: true entryPoints: - webinsecure: + web: address: ":80" # TODO: Redirect when TLS is working # http: @@ -22,8 +22,8 @@ entryPoints: # entryPoint: # to: websecure # scheme: https - # websecure: - # address: ":443" + websecure: + address: ":443" log: level: DEBUG