Compare commits

..

6 commits

Author SHA1 Message Date
f
815f9b23d8 fix: don't leave lockfiles hanging around 2022-11-23 12:34:02 -03:00
f
38c39af601 Merge branch 'master' into antifascista 2022-11-23 12:32:00 -03:00
f
cc4daf6346 use the same dir 2021-02-02 21:05:01 -03:00
f
2750843746 this was prometheus 2021-02-02 21:04:43 -03:00
f
34ac360bfc actually work 2020-09-09 15:52:56 -03:00
f
f106771da9 prometheus 2020-09-09 15:26:37 -03:00
4 changed files with 33 additions and 1 deletions

View file

@ -4,7 +4,7 @@ pipeline:
settings:
registry: registry.nulo.in
username: sutty
repo: registry.nulo.in/sutty/CHANGEME
repo: registry.nulo.in/sutty/prometheus
tags:
- ${ALPINE_VERSION}
- latest

View file

@ -2,3 +2,10 @@ ARG ALPINE_VERSION=3.13.6
ARG BASE_IMAGE=sutty/monit
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
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
View 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
View 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 $?