CommunityScrapers icon indicating copy to clipboard operation
CommunityScrapers copied to clipboard

Docker option to validate

Open Wasylq opened this issue 3 years ago • 2 comments

Dockerfile + description in README on how to use

Wasylq avatar Aug 22 '22 15:08 Wasylq

Is there something missing from it? Can I do something to get this merged?

Wasylq avatar Sep 02 '22 17:09 Wasylq

Is there something missing from it? Can I do something to get this merged?

It took me some time to actually test your PR A few things that i noticed

  • with your Dockerfile you would need to build the container every time you update a scraper as the scrapers are copied and checked inside the container when it is built
  • the COPY . part when building the container copies all the root folder which in some cases can be big (for example if a user uses his stash folder and not a separate clean development folder)

I would create a Dockerfile inside the validator folder like the below

FROM node:current-alpine

RUN mkdir -p /validator

COPY *.* /validator/
WORKDIR /validator
RUN cd /validator && yarn install --frozen-lockfile

Then we would only need to build the container when the validator code changes

sudo docker build -t stash_scrapper_validate validator/

And run the validator whenever we want to check the scrapers

sudo docker run --rm --mount type=bind,source="$(pwd)"/scrapers,target=/scrapers,consistency=delegated stash_scrapper_validate node /validator/index.js

bnkai avatar Sep 05 '22 23:09 bnkai

why even bother with a dockerfile? :)

❯ docker run -v .:/app node:alpine /bin/sh -c "cd /app/validator && yarn install && node index.js --ci"           
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.25s.
Validation passed!

feederbox826 avatar Jun 18 '24 20:06 feederbox826