wip: blah

This commit is contained in:
Nulo 2024-01-11 21:11:12 +00:00 committed by GitHub
parent eb2f04695c
commit a438eec238
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"]
CMD ["busybox", "crond", "-f", "-l2"]