From 198b2f8f965f76043b65774dbc7b5f50e9a216ed Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Thu, 28 Jan 2021 22:31:58 +0100 Subject: [PATCH] Move consumedir entrypoint to docker and fix compose setup To make it work as before, some env variables are necessary to be available to the consumedir container. It's only needed there, but since the env file exists, they are now listed there. Also partially reverts the consumedir.dockerfile. Using the base-image makes sure that all build images are created from the same sources. --- docker/.env | 3 +++ .../consumedir-entrypoint.sh | 1 + docker/consumedir.dockerfile | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) rename {tools/consumedir => docker}/consumedir-entrypoint.sh (98%) diff --git a/docker/.env b/docker/.env index 3bdcc089..da6043cf 100644 --- a/docker/.env +++ b/docker/.env @@ -6,3 +6,6 @@ DB_PORT=5432 DB_NAME=dbname DB_USER=dbuser DB_PASS=dbpass +CONSUMEDIR_VERBOSE=y +CONSUMEDIR_INTEGRATION=y +CONSUMEDIR_POLLING=n \ No newline at end of file diff --git a/tools/consumedir/consumedir-entrypoint.sh b/docker/consumedir-entrypoint.sh similarity index 98% rename from tools/consumedir/consumedir-entrypoint.sh rename to docker/consumedir-entrypoint.sh index dfe20143..76a49824 100644 --- a/tools/consumedir/consumedir-entrypoint.sh +++ b/docker/consumedir-entrypoint.sh @@ -70,6 +70,7 @@ if [ -z "${CONSUMEDIR_ARGS}" ]; then CONSUMEDIR_ARGS="$CONSUMEDIR_ARGS $CONSUMEDIR_ENDPOINT" fi +echo "Command: $CONSUMEDIR_SCRIPT $CONSUMEDIR_ARGS" if [ "${CONSUMEDIR_POLLING-n}" = "y" ]; then echo "Running in polling mode" while [ : ] diff --git a/docker/consumedir.dockerfile b/docker/consumedir.dockerfile index cb0f82b2..ad96ca90 100644 --- a/docker/consumedir.dockerfile +++ b/docker/consumedir.dockerfile @@ -1,13 +1,21 @@ ## CONSUMEDIR -FROM alpine:latest -LABEL maintainer="eikek0 " +ARG VERSION= +ARG REPO= + +# hack to use args in from +FROM ${REPO}:base-binaries-${VERSION} as docspell-base-binaries + + +FROM ${REPO}:base-${VERSION} RUN apk add --no-cache curl bash inotify-tools -COPY ./tools/consumedir /opt/consumedir +COPY --from=docspell-base-binaries /opt/docspell-tools /opt/docspell-tools +COPY consumedir-entrypoint.sh /opt/docspell-tools/consumedir/ +RUN chmod 755 /opt/docspell-tools/**/*.sh -ENTRYPOINT ["bash", "/opt/consumedir/consumedir-entrypoint.sh"] +ENTRYPOINT ["bash", "/opt/docspell-tools/consumedir/consumedir-entrypoint.sh"] HEALTHCHECK --interval=1m --timeout=10s --retries=2 --start-period=10s \ CMD pgrep bash