From f106771da9285fbe926d013ba8366076c922971e Mon Sep 17 00:00:00 2001 From: f Date: Wed, 9 Sep 2020 15:26:37 -0300 Subject: [PATCH] prometheus --- Dockerfile | 6 ++++++ prometheusd.sh | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100755 prometheusd.sh diff --git a/Dockerfile b/Dockerfile index 59c5898..9aa7cdf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,8 @@ FROM sutty/monit:latest MAINTAINER "f " + +RUN apk add --no-cache prometheus daemonize +COPY ./prometheusd.sh /usr/local/bin/prometheusd + +EXPOSE 9090 +VOLUME /var/lib/prometheus diff --git a/prometheusd.sh b/prometheusd.sh new file mode 100755 index 0000000..c5ccb17 --- /dev/null +++ b/prometheusd.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +pid=/tmp/prometheus.pid +var=/var/lib/prometheus +log=/dev/log + +chown prometheus:prometheus /var/lib/prometheus/data + +daemonize -p "${pid}" -l "${pid}" -u prometheus -c "${var}" -a -o "${log}" -e "${log}" \ + /usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path="${var}/data"