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.
This commit is contained in:
Eike Kettner 2021-01-28 22:31:58 +01:00
parent e9f30e0990
commit 198b2f8f96
3 changed files with 16 additions and 4 deletions

View File

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

View File

@ -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 [ : ]

View File

@ -1,13 +1,21 @@
## CONSUMEDIR
FROM alpine:latest
LABEL maintainer="eikek0 <eike@docspell.org>"
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