florjanklancar
HOBBYOP
23 days ago
Hey everyone I'm new to the channel and to railway platform and I'm having issues with my NextJS app being very slow in production it almost feels like the development server is running in production build - even static site pages are taking 1-3seconds to load…
This is my configuration I have a monorepo of a few services and a nextjs @web package:
//apps/web/package.json
"name": "@paydocs/web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"build": "next build",
"start": "bun server.js",
"type-check": "tsc --noEmit"
},
"dependencies": {
...
"next": "16.1.1",
...
},
"devDependencies": {
...
}
}5 Replies
this is my docker file discord does not allow me to copy and paste…
these are my settings if i use this build command the application crashes with:
if i remove the Custom Start Command the application builds but its very slow
"build": {
"builder": "dockerfile",
"dockerfilePath": "apps/web/Dockerfile",
"context": ".",
"buildArgs": {
"DATABASE_URL": "$DATABASE_URL",
"NEXT_PUBLIC_SUPABASE_URL": "$NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_SUPABASE_ANON_KEY": "$NEXT_PUBLIC_SUPABASE_ANON_KEY",
"NEXT_PUBLIC_APP_URL": "$NEXT_PUBLIC_APP_URL",
"NEXT_PUBLIC_API_URL": "$NEXT_PUBLIC_API_URL",
"NEXT_PUBLIC_POSTHOG_KEY": "$NEXT_PUBLIC_POSTHOG_KEY"
}
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
