From cebe2eb7059d364fd679ceb3396b4407ac51e743 Mon Sep 17 00:00:00 2001 From: mw Date: Wed, 21 Dec 2022 11:08:00 +0100 Subject: [PATCH] add entrypoint script and update dockerfile --- Dockerfile | 15 +++++++-------- entrypoint.sh | 9 +++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 30e70f8..ef93d32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ -FROM 3.11.1-alpine3.17 +FROM python:3.11.1-alpine3.17 -RUN adduser -D app && apk update && apk add fetchmail +RUN adduser -D app && apk update && apk add fetchmail runuser -USER app -WORKDIR /app +COPY ./requirements.txt /home/app/requirements.txt +COPY ./pmml.py /home/app/pmml.py +COPY ./entrypoint.sh /home/app/entrypoint.sh -COPY ./requirements.txt ./requirements.txt +RUN pip install -r /home/app/requirements.txt -RUN pip install -r requirements.txt - -ENTRYPOINT ["fetchmail"] +ENTRYPOINT ["/home/app/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..3697b64 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +DOCKER_USER=app +DOCKER_HOME=/home/app + +chown app $DOCKER_HOME/.fetchmailrc +chown app $DOCKER_HOME/pmml.py +chown app $DOCKER_HOME/.pmmlrc +exec runuser -u $DOCKER_USER -- fetchmail -d 60 -N