summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authoryyamashita <yyamashita@mosquit.one>2026-05-08 00:14:43 +0900
committeryyamashita <yyamashita@mosquit.one>2026-05-08 00:14:43 +0900
commit0d644012861798f37e041009fc818c9c9ab9352d (patch)
tree6b65417f87de0fbe264532a3745ca60dd02ea29f /Dockerfile
parent8f64dcc0e4e389903e6a7198d0a2b11498fcd948 (diff)
Run scrape immediately on container start before handing off to cron
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
index 9977bbe..f5cfdb3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -32,4 +32,6 @@ RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/*
RUN echo '0 */6 * * * root cd /app && DB_PATH=/app/data/events.db node --import tsx/esm scripts/scrape.ts >> /app/data/scraper.log 2>&1' > /etc/cron.d/scraper \
&& chmod 0644 /etc/cron.d/scraper
RUN mkdir -p /app/data
-CMD ["cron", "-f"]
+COPY scripts/scraper-entrypoint.sh ./scripts/scraper-entrypoint.sh
+RUN chmod +x scripts/scraper-entrypoint.sh
+CMD ["sh", "scripts/scraper-entrypoint.sh"]