diff --git a/Dockerfile b/Dockerfile index 447fed0..9723000 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM alpine:3.9 MAINTAINER Werner Beroux +RUN apk add --update coreutils && rm -rf /var/cache/apk/* RUN set -x && \ apk add --no-cache -t .deps ca-certificates && \ # Install glibc on Alpine (required by docker-compose) from diff --git a/README.md b/README.md index 6c17469..4bbb2d1 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Additionally, you can specify one of several environment variable (via `-e`) to * `NGROK_REGION` - Location of the ngrok tunnel server; can be `us` (United States, default), `eu` (Europe), `ap` (Asia/Pacific) or `au` (Australia) * `NGROK_LOOK_DOMAIN` - This is the domain name referred to by ngrok. (default: localhost). * `NGROK_BINDTLS` - Toggle tunneling only HTTP or HTTPS traffic. When `true`, Ngrok only opens the HTTPS endpoint. When `false`, Ngrok only opens the HTTP endpoint + * `NGROK_TIMEOUT` - Kill the ngrok process after the timeout value (typically `24h`). Quite handy to use with the `restart: on-failure` option in your docker-compose.yml #### Full example diff --git a/entrypoint.sh b/entrypoint.sh index ac473de..8e4cedb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,10 @@ fi ARGS="ngrok" +if [ -n "$NGROK_TIMEOUT" ]; then + ARGS="timeout $NGROK_TIMEOUT $ARGS" +fi + # Set the protocol. if [ "$NGROK_PROTOCOL" = "TCP" ]; then ARGS="$ARGS tcp"