mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 03:26:19 +00:00
Compare commits
7 commits
43954d7af8
...
448341d4e9
Author | SHA1 | Date | |
---|---|---|---|
448341d4e9 | |||
f68ede609d | |||
dbdd19a4c2 | |||
923dd0b910 | |||
10ea426fb1 | |||
adb98caa7f | |||
7c967a8d74 |
6 changed files with 8 additions and 42 deletions
|
@ -11,3 +11,4 @@ Dockerfile
|
|||
*.warc.zst
|
||||
.git
|
||||
scraper/debug/
|
||||
*/target/
|
29
.github/workflows/container.yml
vendored
29
.github/workflows/container.yml
vendored
|
@ -25,34 +25,6 @@ jobs:
|
|||
- run: bun check
|
||||
working-directory: ./scraper
|
||||
|
||||
build-and-push-scraper:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
file: scraper/Containerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-and-push-sitio:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -77,7 +49,6 @@ jobs:
|
|||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
file: sitio/Containerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
|
@ -10,8 +10,8 @@ RUN cd sitio && \
|
|||
bun run build
|
||||
RUN bun build scraper/cli.ts --target=bun --outfile=/tmp/cli.build.js
|
||||
|
||||
FROM base
|
||||
RUN apk add --no-cache tini nodejs npm jq
|
||||
FROM cgr.dev/chainguard/wolfi-base
|
||||
RUN apk add --no-cache nodejs npm jq bun
|
||||
|
||||
# Sitio
|
||||
COPY --from=build /usr/src/app/sitio/package.json package.real.json
|
||||
|
@ -27,5 +27,4 @@ ENV NODE_ENV=production
|
|||
ENV DB_PATH=/db/db.db
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
CMD ["node", "."]
|
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -38,7 +38,7 @@
|
|||
"better-sqlite3": "^9.2.2",
|
||||
"chart.js": "^4.4.1",
|
||||
"chartjs-adapter-dayjs-4": "^1.0.4",
|
||||
"cron": "^3.1.6",
|
||||
"croner": "^8.0.0",
|
||||
"dayjs": "^1.11.10",
|
||||
"drizzle-orm": "^0.29.1"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
import { spawn } from "child_process";
|
||||
import { CronJob } from "cron";
|
||||
import Cron from "croner";
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
const job = CronJob.from({
|
||||
cronTime: "0 3 * * *",
|
||||
onTick: function () {
|
||||
const job = Cron("15 3 * * *", () => {
|
||||
runScraper();
|
||||
},
|
||||
start: true,
|
||||
timeZone: "America/Argentina/Buenos_Aires",
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue