Compare commits
No commits in common. "antifascista" and "7321da79ccc35bb889e7df5eda4f9a5ca4e1c0d6" have entirely different histories.
antifascis
...
7321da79cc
5 changed files with 36 additions and 45 deletions
|
@ -1,24 +1,22 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
publish:
|
publish:
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
registry: registry.nulo.in
|
||||||
registry: registry.nulo.in
|
repo: registry.nulo.in/sutty/syncthing
|
||||||
username: sutty
|
tags:
|
||||||
repo: registry.nulo.in/sutty/syncthing
|
- ${ALPINE_VERSION}
|
||||||
tags:
|
- latest
|
||||||
- ${ALPINE_VERSION}
|
build_args:
|
||||||
- latest
|
- ALPINE_VERSION=${ALPINE_VERSION}
|
||||||
build_args:
|
- BASE_IMAGE=registry.nulo.in/sutty/monit
|
||||||
- ALPINE_VERSION=${ALPINE_VERSION}
|
username: sutty
|
||||||
- BASE_IMAGE=registry.nulo.in/sutty/monit
|
|
||||||
secrets:
|
secrets:
|
||||||
- docker_password
|
- docker_password
|
||||||
when:
|
when:
|
||||||
branch: antifascista
|
branch: antifascista
|
||||||
event: push
|
event: push
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
ALPINE_VERSION:
|
ALPINE_VERSION:
|
||||||
- 3.16.2
|
- 3.13.6
|
||||||
- 3.15.6
|
- 3.14.2
|
||||||
- 3.14.8
|
|
||||||
- 3.13.12
|
|
||||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -3,15 +3,21 @@ 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>"
|
||||||
|
|
||||||
|
COPY ./syncthing_start.sh /usr/local/bin/syncthing_start
|
||||||
|
RUN chmod 755 /usr/local/bin/syncthing_start
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
||||||
|
ARG ALPINE_VERSION
|
||||||
|
|
||||||
# Syncthing runs with Sutty's uid and gid so ownership is kept, because
|
# Syncthing runs with Sutty's uid and gid so ownership is kept, because
|
||||||
# they are not synced.
|
# they are not synced.
|
||||||
RUN getent group 82 || addgroup -g 82 -S www-data
|
RUN addgroup -g 82 -S syncthing
|
||||||
RUN adduser -s /bin/sh -G www-data -D -u 1000 -h /home/syncthing syncthing
|
RUN adduser -s /bin/sh -G syncthing -D -u 1000 -h /home/syncthing syncthing
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates daemonize syncthing
|
RUN apk add --no-cache ca-certificates daemonize syncthing
|
||||||
|
|
||||||
COPY ./monit.conf /etc/monit.d/syncthing.conf
|
COPY ./monit.conf /etc/monit.d/syncthing.conf
|
||||||
COPY ./syncthingd.sh /usr/local/bin/syncthingd
|
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start
|
||||||
|
|
||||||
EXPOSE 22000
|
EXPOSE 22000
|
||||||
EXPOSE 22000/udp
|
EXPOSE 22000/udp
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
check process syncthing with pidfile /tmp/syncthing.pid
|
check process syncthing with pidfile /tmp/syncthing.pid
|
||||||
start program = "/usr/local/bin/syncthingd start"
|
start program = "/usr/local/bin/syncthing_start"
|
||||||
stop program = "/usr/local/bin/syncthingd stop"
|
stop program = "/bin/sh -c 'cat /tmp/syncthing.pid | xargs kill'"
|
||||||
|
|
||||||
check filesystem root with path /home/syncthing/Sync
|
|
||||||
if space usage < 2% then alert
|
|
||||||
|
|
13
syncthing_start.sh
Normal file
13
syncthing_start.sh
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pid=/tmp/syncthing.pid
|
||||||
|
dir=/home/syncthing
|
||||||
|
log=${dir}/syncthing.log
|
||||||
|
|
||||||
|
rm -f ${pid}
|
||||||
|
|
||||||
|
install -dm 2750 -o syncthing -g syncthing ${dir}/Sync/.stfolder
|
||||||
|
|
||||||
|
daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \
|
||||||
|
-o ${log} -a -e ${log} \
|
||||||
|
/usr/bin/syncthing -no-browser -gui-address='http://0.0.0.0:8443'
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
pid=/tmp/syncthing.pid
|
|
||||||
dir=/home/syncthing
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
start)
|
|
||||||
install -dm 2750 -o syncthing -g syncthing ${dir}/Sync/.stfolder
|
|
||||||
|
|
||||||
daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \
|
|
||||||
/usr/local/bin/syslogize \
|
|
||||||
/usr/bin/syncthing serve \
|
|
||||||
--gui-address=http://[::]:8384 \
|
|
||||||
--no-browser \
|
|
||||||
--no-restart \
|
|
||||||
--no-upgrade \
|
|
||||||
--unpaused
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
test ! -f $pid || cat ${pid} | xargs -r kill
|
|
||||||
rm -f ${pid}
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in a new issue