mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-25 19:16:19 +00:00
wip: blah
This commit is contained in:
parent
eb2f04695c
commit
a438eec238
1 changed files with 5 additions and 5 deletions
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue