summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile4
-rw-r--r--scripts/scraper-entrypoint.sh6
2 files changed, 9 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"]
diff --git a/scripts/scraper-entrypoint.sh b/scripts/scraper-entrypoint.sh
new file mode 100644
index 0000000..87bc0c8
--- /dev/null
+++ b/scripts/scraper-entrypoint.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+node --import tsx/esm scripts/scrape.ts
+
+exec cron -f