diff --git a/Dockerfile.scraper b/Dockerfile.scraper index 2157687..491913b 100644 --- a/Dockerfile.scraper +++ b/Dockerfile.scraper @@ -11,10 +11,11 @@ RUN bun build scraper/cli.ts --target=bun --outfile=/tmp/cli.build.js FROM ghcr.io/rust-lang/rust:nightly-bookworm-slim as rs-build WORKDIR /usr/src/app COPY scraper-rs/ . +RUN apt-get update && apt-get install -y libsqlite3-dev && rm -rf /var/lib/apt/lists/* RUN cargo install --path . FROM docker.io/oven/bun:1-slim -RUN apt-get update && apt-get install -y cron && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y busybox-static sqlite3 && rm -rf /var/lib/apt/lists/* # Scraper COPY --from=build /tmp/cli.build.js /bin/scraper @@ -25,8 +26,7 @@ ENV NODE_ENV=production ENV DB_PATH=/db/db.db # Cron scraper -RUN printf "0 2 * * * bun /bin/scraper auto\n" > /etc/cron.d/scraper \ - && chmod 0644 /etc/cron.d/scraper \ - && crontab /etc/cron.d/scraper +RUN mkdir -p /var/spool/cron/crontabs \ + && printf "0 2 * * * bun /bin/scraper auto\n" > /var/spool/cron/crontabs/root -CMD ["cron", "-f"] \ No newline at end of file +CMD ["busybox", "crond", "-f", "-l2"]