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