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"