Skip to content

Commit

Permalink
improve docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Mar 8, 2017
1 parent f39792f commit 0899455
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENV NGIX_HOST http://localhost
ENV METRICS_ENDPOINT "/metrics"
ENV METRICS_ADDR ":9913"
ENV DEFAULT_METRICS_NS "nginx"
ENV DEFAULT_VERSION "v0.3"

EXPOSE 9913

Expand Down
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ binary="/app/nginx-vts-exporter"
default_status="$NGIX_HOST/status/format/json"
NGINX_STATUS=${NGINX_STATUS:-$default_status}
METRICS_NS=${METRICS_NS:-$DEFAULT_METRICS_NS}
VERSION=${VERSION:-$DEFAULT_VERSION}

wget https://github.com/hnlq715/nginx-vts-exporter/releases/download/${VERSION}/nginx-vts-exporter-linux-amd64.tar.gz
tar xf nginx-vts-exporter-linux-amd64.tar.gz
mv nginx-vts-exporter-linux-amd64 $binary
rm nginx-vts-exporter-linux-amd64.tar.gz
# If there are any arguments then we want to run those instead
#if [[ "$1" == "$binary" || -z $1 ]]; then
# exec "$@"
Expand All @@ -15,5 +20,6 @@ METRICS_NS=${METRICS_NS:-$DEFAULT_METRICS_NS}
#echo "[$0] - Metrics Endpoint --> [$METRICS_ENDPOINT]"
#echo "[$0] - Metrics Namespace --> [$METRICS_NS]"
#echo "[$0] - Running metrics nginx-vts-exporter"

exec "$binary" -nginx.scrape_uri=$NGINX_STATUS -telemetry.address $METRICS_ADDR -telemetry.endpoint $METRICS_ENDPOINT -metrics.namespace $METRICS_NS
#fi

0 comments on commit 0899455

Please sign in to comment.