version: "3" services: web: container_name: ${CONTAINER_NAME} image: bitweb/number-to-words-api:${APP_VERSION} expose: - 80 labels: - traefik.enable=true ### Section HTTP - traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http # redirect to HTTPS only - 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-${TRAEFIK_ROUTER}.entrypoints=https # configure the exposed service - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) # of course, enable TLS and it's certificate provider - 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 networks: traefik-proxy: external: true