Improve docker setup and update scripts

This commit is contained in:
2026-06-12 19:48:20 +02:00
parent ab79e7e543
commit c2c2e2d666
7 changed files with 175 additions and 30 deletions
+10 -7
View File
@@ -1,15 +1,18 @@
# Use lightweight Nginx + Git
# environment variables necessary to run:
# REPO_URL the url of this repo
# BRANCH the branch to work at
FROM nginx:alpine
# Install git and bash
RUN apk add --no-cache git bash
# Copy nginx config
COPY nginx.conf /etc/nginx/nginx.conf
# Copy update script
COPY update.sh /update.sh
RUN chmod +x /update.sh
# Start update loop + nginx
CMD ["/bin/bash", "-c", "/update.sh & nginx -g 'daemon off;'"]
# Add the cron job to run every 30 minutes
# Redirecting to /proc/1/fd/1 ensures the script's echo statements show up in `docker logs`
RUN echo "*/30 * * * * bash /update.sh > /proc/1/fd/1 2>&1" > /etc/crontabs/root
# Start the cron daemon in the background (-b) and nginx in the foreground
CMD crond -b && nginx -g 'daemon off;'