jjablonski-it / webscraper-bot

Web scraping Discord bot that notifies if new item appears
27 stars 10 forks source link

is there A way to self host the bot #5

Closed GiannisDorokidis closed 5 months ago

GiannisDorokidis commented 10 months ago

Is there a way to self host the bot? Because the bot has joined multiple servers and can't join more can you make a guide how to host it or even better for compatibility make a docker image?

jjablonski-it commented 5 months ago

Hey, if you want to self host it in container you could use something like 👇 and add this argument to Puppeteer: executablePath: process.env.PUPPETEER_EXECUTABLE_PATH

FROM node:21

RUN apt-get update && apt-get install -y wget gnupg
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
    && apt-get update \
    && apt-get install -y google-chrome-stable

ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable

WORKDIR /app
COPY package.json ./
COPY pnpm-lock.yaml ./

RUN npm install -g pnpm prisma typescript

ENV NODE_ENV development 

COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm prisma generate
RUN pnpm build

ENV NODE_ENV production

CMD ["pnpm", "run", "start"]

Something like this should do it but I haven't tested it, I no longer work on this bot version. But, if you are stil interested I published new, upgraded version of this bot. You can find out more here: https://notifast.me