Create DockerfIle

Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
Kjeld Schouten
2025-08-07 20:49:10 +02:00
committed by GitHub
parent d66783f56b
commit 9c04b0c7dd
+26
View File
@@ -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"