Initial commit.

This commit is contained in:
yohan 2019-07-15 22:03:39 +02:00
commit ab2f8dcfed
4 changed files with 41 additions and 0 deletions

9
Dockerfile Normal file
View File

@ -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"]

1
build Normal file
View File

@ -0,0 +1 @@
docker build -t feed2imap .

30
entrypoint.sh Executable file
View File

@ -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

1
launch.sh Normal file
View File

@ -0,0 +1 @@
docker run -d --network=mailnet --name feed2imap feed2imap