generalized repository
- changed repository name in README.md - variabilized Træfik settings - added Træfik service - removed unnecessary port exposure
This commit is contained in:
parent
c014830d37
commit
f15daabb89
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user