A community based topic aggregation platform built on atproto
at main 1.3 kB view raw
1# Kagi News RSS Aggregator 2# Production-ready Docker image with cron scheduler 3 4FROM python:3.11-slim 5 6# Install cron and other utilities 7RUN apt-get update && apt-get install -y \ 8 cron \ 9 curl \ 10 procps \ 11 && rm -rf /var/lib/apt/lists/* 12 13# Set working directory 14WORKDIR /app 15 16# Copy requirements first for better caching 17COPY requirements.txt . 18 19# Install Python dependencies (exclude dev/test deps in production) 20RUN pip install --no-cache-dir \ 21 feedparser==6.0.11 \ 22 beautifulsoup4==4.12.3 \ 23 requests==2.31.0 \ 24 atproto==0.0.55 \ 25 pyyaml==6.0.1 26 27# Copy application code 28COPY src/ ./src/ 29COPY config.yaml ./ 30 31# Copy crontab file 32COPY crontab /etc/cron.d/kagi-aggregator 33 34# Give execution rights on the cron job and apply it 35RUN chmod 0644 /etc/cron.d/kagi-aggregator && \ 36 crontab /etc/cron.d/kagi-aggregator 37 38# Create log file to be able to run tail 39RUN touch /var/log/cron.log 40 41# Copy entrypoint script 42COPY docker-entrypoint.sh /usr/local/bin/ 43RUN chmod +x /usr/local/bin/docker-entrypoint.sh 44 45# Health check - verify cron is running 46HEALTHCHECK --interval=60s --timeout=10s --start-period=10s --retries=3 \ 47 CMD pgrep cron || exit 1 48 49# Run the entrypoint script 50ENTRYPOINT ["docker-entrypoint.sh"] 51 52# Default command: tail the cron log 53CMD ["tail", "-f", "/var/log/cron.log"]