From 07fda7adf58ea2d57bce0d1fcef66cca1e492ab9 Mon Sep 17 00:00:00 2001 From: leej3 Date: Tue, 6 Aug 2024 21:23:20 +0100 Subject: [PATCH] working for http --- web_api/docker-compose.yaml.j2 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/web_api/docker-compose.yaml.j2 b/web_api/docker-compose.yaml.j2 index d7c01ded..09d4f5b2 100644 --- a/web_api/docker-compose.yaml.j2 +++ b/web_api/docker-compose.yaml.j2 @@ -7,9 +7,9 @@ services: working_dir: /app/app labels: - traefik.enable=true - - traefik.http.services.osm_web_api.loadbalancer.server.port=80 - - traefik.http.routers.osm_web_api-http.rule=Host(`osm.pythonaisolutions.com`) - - traefik.http.routers.osm_web_api-http.entrypoints=http + - traefik.http.routers.osm_web_api.rule=Host(`osm.pythonaisolutions.com`) + - traefik.http.routers.osm_web_api.entrypoints=http + - traefik.http.services.osm_web_api-http.loadbalancer.server.port=80 - traefik.docker.network=traefik-public # https - traefik.http.routers.osm_web_api-https.rule=Host(`osm.pythonaisolutions.com`) @@ -22,6 +22,8 @@ services: - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true # apply the redirect middleware to the http router - traefik.http.routers.osm_web_api-http.middlewares=https-redirect + networks: + - traefik-public traefik: image: traefik @@ -33,13 +35,15 @@ services: - --providers.docker.exposedbydefault=false - --entrypoints.http.address=:80 - --entrypoints.https.address=:443 - - --certificatesresolvers.le.acme.email={{ cert_email }} + - "--certificatesresolvers.le.acme.email={{ cert_email }}" - --certificatesresolvers.le.acme.storage=/certificates/acme.json - --certificatesresolvers.le.acme.tlschallenge=true - --log - --accesslog + - --api.insecure=true ports: - 80:80 + - 8080:8080 - 443:443 volumes: - /var/run/docker.sock:/var/run/docker.sock:ro @@ -48,6 +52,18 @@ services: - traefik-public + whoami: + image: "traefik/whoami" + container_name: "simple-service" + labels: + - "traefik.enable=true" + - "traefik.http.routers.whoami.rule=Host(`osm.pythonaisolutions.com`)" + - "traefik.http.routers.whoami.entrypoints=https" + - "traefik.http.routers.whoami.tls.certresolver=le" + networks: + - traefik-public + + volumes: traefik-public-certificates: