Skip to content

Commit

Permalink
Change the working directory that the Docker container runs from
Browse files Browse the repository at this point in the history
  • Loading branch information
yutotakano committed Feb 29, 2024
1 parent 4285fc3 commit 20a983b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
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

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

0 comments on commit 20a983b

Please sign in to comment.