R
Railway•9mo ago
Danny

Installing apt packages for puppeteer

Hi, im trying to run puppeteer on Railway but am getting an error that it cant find some packages. I had the same issue when selfhosting and fixed it by apt installing some stuff. How can i do this on Railway?
8 Replies
Percy
Percy•9mo ago
Project ID: N/A
Danny
Danny•9mo ago
n/a
Medim
Medim•9mo ago
Nixpacks has ton of additional packages that you can provide to your build through a nixpacks.toml file in the root of your service dir for example:
[phases.setup]
aptPkgs = [
'fonts-liberation',
'libappindicator3-1',
'libasound2',
'libatk-bridge2.0-0',
'libatk1.0-0',
'libgbm1',
'libgtk-3-0',
'libnspr4',
'libnss3',
'libx11-xcb1',
'libxcomposite1',
'libxcursor1',
'libxdamage1',
'libxfixes3',
'libxi6',
'libxrandr2',
'libxss1',
'libxtst6',
'xdg-utils'
]
[phases.setup]
aptPkgs = [
'fonts-liberation',
'libappindicator3-1',
'libasound2',
'libatk-bridge2.0-0',
'libatk1.0-0',
'libgbm1',
'libgtk-3-0',
'libnspr4',
'libnss3',
'libx11-xcb1',
'libxcomposite1',
'libxcursor1',
'libxdamage1',
'libxfixes3',
'libxi6',
'libxrandr2',
'libxss1',
'libxtst6',
'xdg-utils'
]
just put your aptPkgs there and try building it
Danny
Danny•9mo ago
Thanks!
Medim
Medim•9mo ago
you can search for the package in https://search.nixos.org/packages if it exists/is supported and you can read more about nixpacks config at https://docs.railway.app/deploy/config-as-code
Brody
Brody•9mo ago
may I ask what you are doing with puppeteer?
Danny
Danny•9mo ago
i was using it for a whatsapp bot but saw it wasnt allowed, im now rebuilding my bot into a mobile app 😛
Brody
Brody•9mo ago
hey good on you! I wish you luck with that!