mmmonit
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2022-03-14 18:14:24 -03:00
parent a299ab663f
commit 6e6c61180f
4 changed files with 34 additions and 4 deletions

View file

@ -2,7 +2,7 @@ pipeline:
publish: publish:
image: plugins/docker image: plugins/docker
registry: registry.nulo.in registry: registry.nulo.in
repo: registry.nulo.in/sutty/CHANGEME repo: registry.nulo.in/sutty/mmmonit
tags: tags:
- ${ALPINE_VERSION} - ${ALPINE_VERSION}
- latest - latest
@ -18,5 +18,3 @@ pipeline:
matrix: matrix:
ALPINE_VERSION: ALPINE_VERSION:
- 3.15.0 - 3.15.0
- 3.14.3
- 3.13.7

View file

@ -1,4 +1,12 @@
ARG ALPINE_VERSION=3.13.6 ARG ALPINE_VERSION=3.15.0
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 mmmonit daemonize
COPY ./monit.conf /etc/monit.d/mmmonit.conf
COPY ./mmmonitd.sh /usr/local/bin/mmmonitd
EXPOSE 3000/tcp
VOLUME /srv

21
mmmonitd.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
set -e
dir=${DIR:-/srv}
pid=/run/mmmonit.pid
# TODO: Log to syslog
log=${dir}/mmmonit.log
usr=${USER:-nobody}
case $1 in
start)
chown -R ${usr}:${usr} ${dir}
install -dm 750 -o ${usr} -g ${usr} ${dir}/storage ${dir}/storage/xml
daemonize -a -e ${log} -o ${log} -c ${dir} -p ${pid} -l ${pid} -u ${usr} /usr/bin/mmmonit
;;
stop)
test -f ${pid} || exit 0
cat ${pid} | xargs -r kill
;;
esac

3
monit.conf Normal file
View file

@ -0,0 +1,3 @@
check process mmmonit with pidfile /run/mmmonit.pid
start program = "/usr/local/bin/mmmonitd start"
stop program = "/usr/local/bin/mmmonitd stop"