diff --git a/containers/apps/bfics/DockerfIle b/containers/apps/bfics/DockerfIle new file mode 100644 index 00000000000..1281e067337 --- /dev/null +++ b/containers/apps/bfics/DockerfIle @@ -0,0 +1,26 @@ +FROM python:3.12-alpine + +# Install dependencies +RUN pip install --no-cache-dir requests beautifulsoup4 + +# Create working directory +WORKDIR /app + +# Copy code +COPY --chmod=775 ./containers/apps/bfics/includes/balfolk_ical.py /app/balfolk_ical.py +COPY --chmod=775 ./containers/apps/bfics/includes/crontab.txt /app/crontab.txt + + +# Create output dir for serving +RUN touch /app/balfolk.ics + +# Setup cron +RUN apk add --no-cache bash curl busybox-suid && \ + echo "#!/bin/sh\ncrond -f -L /dev/stdout" > /start.sh && \ + chmod +x /start.sh + +# Install cron job +RUN crontab /app/crontab.txt + +# Start cron and HTTP server +CMD sh -c "crond -f -L /dev/stdout & python3 -m http.server 8000 --directory /app"