diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b9c898 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ruby:2.5.3-slim +MAINTAINER + +# Metadata +ENV \ + EXPORTER_APPDIR=/opt/twemproxy_exporter \ + USER=exporter + +# Prep and copy +RUN mkdir $EXPORTER_APPDIR && \ + useradd $USER +COPY . $EXPORTER_APPDIR +WORKDIR $EXPORTER_APPDIR + +RUN apt-get update -y && \ + apt-get install git bundler -y && \ + bundle && \ + rm -rf /var/lib/apt/lists/* && \ + chown -R $USER $EXPORTER_APPDIR && \ + chmod 755 $EXPORTER_APPDIR/bin/* + +USER $USER +EXPOSE 9876 +CMD "/opt/twemproxy_exporter/bin/run.sh" diff --git a/bin/run.sh b/bin/run.sh new file mode 100644 index 0000000..591c773 --- /dev/null +++ b/bin/run.sh @@ -0,0 +1,2 @@ +export EXPORTER_APPDIR=/opt/twemproxy_exporter +$EXPORTER_APPDIR/bin/twemproxy_exporter -f $EXPORTER_APPDIR/conf/config.yaml diff --git a/conf/config.yaml b/conf/config.yaml new file mode 100644 index 0000000..59cc108 --- /dev/null +++ b/conf/config.yaml @@ -0,0 +1,6 @@ +bind: 0.0.0.0 +port: 9876 +interval: 10 +timeout: 3 +proxies: +- twemproxy.namespace.svc.cluster.local:22222