Create DockerfIle
Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user