Compare commits
6 commits
c4d0c8ac35
...
815f9b23d8
Author | SHA1 | Date | |
---|---|---|---|
|
815f9b23d8 | ||
|
38c39af601 | ||
|
cc4daf6346 | ||
|
2750843746 | ||
|
34ac360bfc | ||
|
f106771da9 |
4 changed files with 33 additions and 1 deletions
|
@ -4,7 +4,7 @@ pipeline:
|
||||||
settings:
|
settings:
|
||||||
registry: registry.nulo.in
|
registry: registry.nulo.in
|
||||||
username: sutty
|
username: sutty
|
||||||
repo: registry.nulo.in/sutty/CHANGEME
|
repo: registry.nulo.in/sutty/prometheus
|
||||||
tags:
|
tags:
|
||||||
- ${ALPINE_VERSION}
|
- ${ALPINE_VERSION}
|
||||||
- latest
|
- latest
|
||||||
|
|
|
@ -2,3 +2,10 @@ ARG ALPINE_VERSION=3.13.6
|
||||||
ARG BASE_IMAGE=sutty/monit
|
ARG BASE_IMAGE=sutty/monit
|
||||||
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
||||||
MAINTAINER "f <f@sutty.nl>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
|
RUN apk add --no-cache prometheus daemonize
|
||||||
|
COPY ./monit.conf /etc/monit.d/prometheus.conf
|
||||||
|
COPY ./prometheusd.sh /usr/local/bin/prometheusd
|
||||||
|
|
||||||
|
EXPOSE 9090
|
||||||
|
VOLUME /var/lib/prometheus
|
||||||
|
|
4
monit.conf
Normal file
4
monit.conf
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
check process prometheus with pidfile /tmp/prometheus.pid
|
||||||
|
start program = "/usr/local/bin/prometheusd start"
|
||||||
|
stop program = "/usr/local/bin/prometheusd stop"
|
||||||
|
if 5 restarts within 8 cycles then alert
|
21
prometheusd.sh
Executable file
21
prometheusd.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pid=/tmp/prometheus.pid
|
||||||
|
var=/var/lib/prometheus
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
stop)
|
||||||
|
test ! -f $pid || cat ${pid} | xargs -r kill
|
||||||
|
rm -f ${pid}
|
||||||
|
;;
|
||||||
|
start)
|
||||||
|
chown -R prometheus:prometheus "${var}"
|
||||||
|
chmod -R u=rwX,g=rX,o= "${var}"
|
||||||
|
|
||||||
|
daemonize -p "${pid}" -l "${pid}" -u prometheus -c "${var}" \
|
||||||
|
/usr/local/bin/syslogize \
|
||||||
|
/usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path="${var}/data"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
Loading…
Reference in a new issue