commit ab2f8dcfed80cac3ede8dceb6f210feb5b3afa99 Author: yohan <783b8c87@scimetis.net> Date: Mon Jul 15 22:03:39 2019 +0200 Initial commit. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..acda50e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:jessie +MAINTAINER yohan <783b8c87@scimetis.net> +ENV DEBIAN_FRONTEND noninteractive +#RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list +RUN apt-get update && apt-get -y install feed2imap +#COPY feed2imaprc /root/ +COPY entrypoint.sh /root/ +RUN chmod +x /root/entrypoint.sh +ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/build b/build new file mode 100644 index 0000000..5c2cb53 --- /dev/null +++ b/build @@ -0,0 +1 @@ +docker build -t feed2imap . diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..2581c07 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# stop service and clean up here +function shut_down() { +reset +echo "exited $0" +exit 0 +} + +# USE the trap if you need to also do manual cleanup after the service is stopped, +# or need to start multiple services in the one container +trap "shut_down" SIGINT SIGTERM SIGKILL + +echo "Launching feed2imap..." +/usr/bin/feed2imap -f /root/feed2imaprc +last=$(date +%s) + +while true +do + sleep 3 + #echo $last + # if date '+%s'` - $last > 1800 (seconds) ==> feed2imap and $last = date '+%s'` + if [ $(($(date +%s) - $last)) -gt 1800 ] + then + echo "Launching feed2imap..." + /usr/bin/feed2imap -f /root/feed2imaprc + last=$(date +%s) + fi +done +shut_down + diff --git a/launch.sh b/launch.sh new file mode 100644 index 0000000..bfb2c1c --- /dev/null +++ b/launch.sh @@ -0,0 +1 @@ +docker run -d --network=mailnet --name feed2imap feed2imap