I’m seeing a Docker-only build failure with Next.js:
Setup
Next.js 16 (with next.config.ts)
Node 20
Docker multi-stage build
ECS (Linux)
Base image: node:20-alpine
Behavior
✅ next build works locally
❌ Fails during Docker build with:
Failed to load next.config.ts
Error: No prebuild or local build of @parcel/watcher found
Tried @parcel/watcher-linux-x64-musl
Notes
Happens only inside Docker
I already tried libc6-compat
Looks like a musl vs glibc / native dependency issue
Error surfaces while loading next.config.ts
Questions
Is Alpine unsupported / risky for Next.js builds due to native deps?
Is switching to node:*-slim the recommended fix for ECS?
Any known best practices here?
Appreciate any insights 🙏
"dependencies": {
"@headlessui/react": "^2.2.9",
"@reduxjs/toolkit": "^2.11.0",
"axios": "^1.13.2",
"embla-carousel-auto-scroll": "^8.6.0",
"embla-carousel-autoplay": "^8.6.0",
"embla-carousel-react": "^8.6.0",
"newrelic": "^13.8.1",
"next": "^16.0.1",
"next-auth": "^4.24.11",
"next-intl": "^4.0.0",
"react": "^19.2.0",
"react-dom": "^19.2.1",
"react-loading-skeleton": "^3.5.0",
"react-redux": "^9.2.0",
"react-toastify": "^11.0.5",
"tailwindcss-rtl": "^0.9.0"
},
"devDependencies": {
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@eslint/eslintrc": "^3.1.0",
"@playwright/test": "^1.51.1",
"@tailwindcss/postcss": "^4",
"@types/lodash": "^4.17.5",
"@types/node": "^20.14.5",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.3",
"@types/newrelic": "^9.14.8",
"commitlint": "^20.1.0",
"eslint": "^9.38.0",
"eslint-config-next": "^16.0.1",
"husky": "^9.1.7",
"lint-staged": "^16.2.6",
"prettier": "^3.6.2",
"tailwindcss": "^4",
"typescript": "^5.9.3"
},