joshuajung / 116117bot

A proof of concept bot, checking impfterminservice.de for available COVID-19 vaccination appointments.
MIT License
34 stars 16 forks source link

Add Docker support #3

Closed sbonfert closed 3 years ago

sbonfert commented 3 years ago

This pull request adds a Dockerfile and sample docker calls to the readme

joshuajung commented 3 years ago

Hi @sbonfert, thanks for the PR!

I'm seeing this issue when running the container:

Booting 116117bot
(node:19) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT

I assume this is due to my Apple Silicon Mac, but I don't have the time to hunt this down right now. Could you confirm this works fine for you? Then I'll gladly merge the PR.

sbonfert commented 3 years ago

I guess you skipped one of the environment variables "-e HEADLESS=true -e NO_PUPPETEER_SANDBOX=true". If you set both of them, it should work as intended. Maybe it's a good idea to include those in the Dockerfile, since the container won't work without them (?)

sbonfert commented 3 years ago

I updated the Dockerfile. The environment variables HEADLESS and NO_PUPPETEER_SANDBOX are now defined there, rather than manually. The call to run the docker container therefore simplifies to: $ docker run --name 116117bot -e URLS="YourUrlHere" 116117bot

joshuajung commented 3 years ago

Thank you! Tried it on an Intel mac and worked like a charm. Merging. :)