From 20a983b48fc5ca1673055b77174dc64f449acfed Mon Sep 17 00:00:00 2001 From: Yuto Takano Date: Thu, 29 Feb 2024 02:44:15 +0000 Subject: [PATCH] Change the working directory that the Docker container runs from --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ac53ac..55cf5de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM alpine +# Create directory for the working directory slash cache +RUN mkdir -p /etc/internal-wiki-notifier # Copy script which should be run COPY ./notify-wikijs-recent-updates.sh /usr/local/bin/notify-wikijs-recent-updates.sh RUN chmod +x /usr/local/bin/notify-wikijs-recent-updates.sh @@ -7,8 +9,10 @@ RUN chmod +x /usr/local/bin/notify-wikijs-recent-updates.sh # Install curl and jq RUN apk add --no-cache curl jq +WORKDIR /etc/internal-wiki-notifier + # Run the cron every 5 minutes -RUN echo '*/5 * * * * /usr/local/bin/notify-wikijs-recent-updates.sh' > /etc/crontabs/root +RUN echo '*/5 * * * * cd /etc/internal-wiki-notifier && /usr/local/bin/notify-wikijs-recent-updates.sh' > /etc/crontabs/root # Run the cron with log level 2, and in foreground so it doesn't exit immediately CMD ["crond", "-l2", "-f"]