clean: remove Hermes cron artifacts, simplify for EasyPanel deploy
Some checks failed
Some checks failed
This commit is contained in:
45
Dockerfile
45
Dockerfile
@@ -1,47 +1,38 @@
|
||||
# ─────────────────────────────────────────────
|
||||
# HuggingFace Daily Paper RSS — Dockerfile
|
||||
# HuggingFace Daily Paper RSS — EasyPanel-ready Dockerfile
|
||||
# ─────────────────────────────────────────────
|
||||
# Two modes:
|
||||
# 1. Run-once (default, for cron):
|
||||
# docker run --rm -v ./feeds:/data hf-paper-rss
|
||||
# 2. HTTP server (serve feeds):
|
||||
# docker run --rm -p 8080:8080 -v ./feeds:/data hf-paper-rss serve
|
||||
# Single container that:
|
||||
# 1. Generates RSS feeds on startup
|
||||
# 2. Serves them via HTTP (port 8080, CORS enabled)
|
||||
# 3. Auto-refreshes every 24h (background thread)
|
||||
#
|
||||
# Deploy on EasyPanel: health check + persistent volume
|
||||
# ─────────────────────────────────────────────
|
||||
|
||||
FROM python:3.11-slim AS base
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system deps
|
||||
# System deps
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python deps
|
||||
# Python deps
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy app code
|
||||
COPY parser.py rss_generator.py run.py run.sh ./
|
||||
# App code
|
||||
COPY parser.py rss_generator.py run.py server.py ./
|
||||
|
||||
# Create output directory
|
||||
RUN mkdir -p /data && chmod 777 /data
|
||||
# Volume for persistent feed output
|
||||
VOLUME ["/data"]
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD python -c "import sys; sys.exit(0 if __import__('os').path.exists('/data/feed.xml') else 1)" \
|
||||
|| true # Allow healthcheck to be optional
|
||||
|
||||
ENTRYPOINT ["python", "run.py"]
|
||||
CMD ["--output-dir", "/data"]
|
||||
|
||||
|
||||
# ─── Serve mode ───
|
||||
FROM base AS serve
|
||||
|
||||
COPY server.py .
|
||||
# Health check — verify feed.xml exists (generated on startup)
|
||||
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
|
||||
CMD python -c "import os; exit(0 if os.path.exists('/data/feed.xml') else 1)"
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["python", "server.py"]
|
||||
CMD ["--dir", "/data", "--port", "8080"]
|
||||
CMD ["--dir", "/data", "--port", "8080", "--refresh", "24"]
|
||||
|
||||
Reference in New Issue
Block a user