How to get chrome in a railway deployment?
I want to deploy a small nodejs cron job which has a dependancy on chrome. But I do not want to use docker because external applications need to use the files produced by the script. What could be the solution?
79 Replies
Project ID:
N/A
N/A
does your app use puppeteer?
yes
puppeteer should install chrome itself
what issues are you running into?
it kept showing chrome not found
send your package.json please
Should I send the deploy logs?
package.json first
does your app use puppeteer?
webdriverio uses puppeteer to launch chrome
not quite, it uses puppeteer-core, the core variant does not install chrome
oh
you might be able to get away with chucking puppeteer in as a dep
so basically adding puppeteer in the dependancies?
but wouldnt webdriverio still use puppeteer-core
yeah but during the install of puppeteer it will install chrome
alright then
just an idea, untested of course
@Brody Do I need to configure it to launch chrome in headless mode or graphical mode will work?
headless
it still show the same error
show error please
before we go any further, can you tell us what website you are trying to scrape?
bseindia.com
do they allow web scraping?
it works when done manually
not what I asked unfortunately
I ran the code like 6 times on pc before trying to deploy
I worded it wrong basically what I mean is "it works on my machine"
again, not what i asked
then?
do they allow web scraping?
yeah
okay cool, can you show me where they give the user permission to scrape their site
What do you mean by scraping though in this instance?
pulling data from the sites html
The website does not allow it but I am not doing that
I am downloading files which the website provides an interface for
so they wouldnt disallow something they literally have made
oh so they have an offical api?
yeah
and you are using it?
yes
okay then you dont even need chrome
I do because I could only figure out some parts of the api
so then you are scraping data
I do not think you understood
The code fills in the data clicks submit and then clicks the download button at the top right corner
how is this scraping
that counts as web scraping, or even botting
then why are they providing this?
providing what
this interface
what are you talking about
either way, this is clearly breaking railway's TOS
please remove this app from railway
It didnt even deploy
Alright so I removed the webscraping part
But it still has some dataprocessing that will remain
when I try to deploy it says failed to upload code
as long as it uses the official api, without chrome, you are good
yeah removed the scraping
but this is the problem now
show me your package.json please
are you deploying from github or cli?
cli
show me the error
what railway version?
railway --version
railwayapp 3.3.1
what is the total size of your project folder (minus node_modules)
821 MB
without node_modules!
yeah without node_modules
what file(s) is making it so big
as I said it is a data processing application
fair, the upload limit on the cli is 50mb
oh
you will want to store the big files in something like cloudflare r2, and download them at runtime on railway
If I want to use a container, I just need to write a dockerfile right no need to build the image?
i dont see what a dockerfile has to do with this
its unrelated
okay then i also dont understand your question