From f15daabb895a35fd383b0977445fea4d9b1aeb3a Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Fri, 7 Jan 2022 13:40:58 +0100 Subject: [PATCH] =?UTF-8?q?generalized=20repository=20-=20changed=20reposi?= =?UTF-8?q?tory=20name=20in=20README.md=20-=20variabilized=20Tr=C3=A6fik?= =?UTF-8?q?=20settings=20-=20added=20Tr=C3=A6fik=20service=20-=20removed?= =?UTF-8?q?=20unnecessary=20port=20exposure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- docker-compose.yml | 15 ++++++++------- env.example | 6 +++++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8bde725..1dc0976 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# number-to-words.api.bjphoster.com +# BitWeb/number-to-words-api Deployment -API deployment for number-to-words service from bitweb +Source: [BitWeb/number-to-words-api](https://github.com/BitWeb/number-to-words-api) diff --git a/docker-compose.yml b/docker-compose.yml index 827bdea..0ba2513 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,17 +9,18 @@ services: labels: - traefik.enable=true ### Section HTTP - - traefik.http.routers.http-number-to-words_api_bjphoster_com.entrypoints=http + - traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http # redirect to HTTPS only - - traefik.http.routers.http-number-to-words_api_bjphoster_com.middlewares=http-to-https - - traefik.http.routers.http-number-to-words_api_bjphoster_com.rule=Host(`number-to-words.api.bjphoster.com`) + - traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https + - traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) ### Section HTTPS - - traefik.http.routers.https-number-to-words_api_bjphoster_com.entrypoints=https + - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https # configure the exposed service - - traefik.http.routers.https-number-to-words_api_bjphoster_com.rule=Host(`number-to-words.api.bjphoster.com`) + - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) # of course, enable TLS and it's certificate provider - - traefik.http.routers.https-number-to-words_api_bjphoster_com.tls=true - - traefik.http.routers.https-number-to-words_api_bjphoster_com.tls.certresolver=letsencrypt + - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=true + - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=letsencrypt + - traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${SERVICE_PORT} networks: - traefik-proxy restart: unless-stopped diff --git a/env.example b/env.example index a7fc655..5f45fa3 100644 --- a/env.example +++ b/env.example @@ -1,2 +1,6 @@ APP_VERSION=latest -CONTAINER_NAME=number-to-words.api.bjphoster.com +CONTAINER_NAME=number-to-words-api.mydomain.com +TRAEFIK_MATCHRULE=number-to-words-api.mydomain.com +TRAEFIK_ROUTER=number-to-words-api_mydomain_com +TRAEFIK_SERVICE=number-to-words-api_mydomain_com +SERVICE_PORT=80