mmmonit
ci/woodpecker/push/woodpecker Pipeline was successful Details

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:
image: plugins/docker
registry: registry.nulo.in
repo: registry.nulo.in/sutty/CHANGEME
repo: registry.nulo.in/sutty/mmmonit
tags:
- ${ALPINE_VERSION}
- latest
@ -18,5 +18,3 @@ pipeline:
matrix:
ALPINE_VERSION:
- 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
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
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"