WhatsApp bot for SHJM Mill production data collection.
git init
git add .
git commit -m "initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -u origin main- Go to railway.app → New Project → Deploy from GitHub repo
- Pick your repo
- Railway will detect the
Dockerfileand build automatically (Node 20 + Chromium + all libs come baked in)
- Service → Settings → Volumes → + New Volume
- Mount path:
/app/.wwebjs_auth - Save
- Open Deployments → latest deployment → View Logs
- A QR code appears in the logs
- WhatsApp on phone → Settings → Linked Devices → Link a Device → scan it
✅ Done. Send "Hi" to your number to test.
The previous nixpacks.toml approach failed because Railway's Nixpacks builder didn't apply the apt packages reliably, so Chromium couldn't find libglib-2.0.so.0.
The Dockerfile includes every shared library Chromium needs and forces Puppeteer to use the system Chromium at /usr/bin/chromium instead of downloading its own. This is the standard, reliable way to run whatsapp-web.js on Railway.
npm install
npm startA QR code will print in your terminal.
.
├── Dockerfile # Build instructions (Node 20 + Chromium + libs)
├── railway.json # Tells Railway to use the Dockerfile
├── .dockerignore # Keeps image small
├── index.js # Bot logic
├── menus.js # Department + OCR menus
├── package.json # Dependencies
├── .gitignore
└── README.md