D
Dokploy•8mo ago
Sang Dang

Help with nextjs build frozen the server issue

To be fair this is not Dokploy issue, I believe. When I try to build my nextjs app inside Dokploy, it uses so much resources that cause the server frozen. A couple months ago, I think @Siumauricio suggested me build the docker image inside Github Actions then use it to deploy on Dokploy, that solution works, the only issue is it cost me 30-40 minutes 😓 for any small PR, because the GA is just too slow. Is there any better suggestions that I could use? We don't have huge budget but could pay something to speed this up. My main goal is making the merge PR => build => deploy on Dokploy easier and faster. Thanks in advance.
14 Replies
Siumauricio
Siumauricio•8mo ago
How much time takes to build in the dokploy server? Also what type of application are you running?
codedj
codedj•8mo ago
Are you building arm64 or amd64?
Sang Dang
Sang DangOP•8mo ago
it's amd64 on AWS, t3.large instance I do quite complex Nextjs application, running inside a Turborepo with a server using Nest, the server build is fine, take around 5 mins, but the Next.js always frozen the server. If I do not hard reboot (on AWS dashboard) it would frozen forever. we don't have the luxury of re-write the whole app in another framework, so please do not suggest changing framework 😦
codedj
codedj•8mo ago
Were you pre-empting Siumauricio suggesting remix /jk Anything to do with this? https://github.com/Dokploy/dokploy/issues/507
Sang Dang
Sang DangOP•8mo ago
no, it is another issue but this is pure Next.js problem
Sang Dang
Sang DangOP•8mo ago
Stack Overflow
Next Build hangs forever
I'm building an app with NextJs and Typescript. I'm trying to run next build (yarn build) on my local machine to check for typescript warnings and build errors before deploying. Next build hangs at '
Sang Dang
Sang DangOP•8mo ago
when it reaches the point "'Creating an optimized production build'", it freeze the whole server not just the its container
Sang Dang
Sang DangOP•8mo ago
I seen it, I even increased the ram to bigger than the comment (they suggeseted 4GB, I put up to 8GB) but it still stuck
Siumauricio
Siumauricio•8mo ago
got it how much time takes to build the nextjs app in your personal machine?
codedj
codedj•8mo ago
They are talking about all kinds of things there, like commenting out google font, killing background node processes etc. You are making me second guess my next.js decision 😆 Just to cover the basics, you are filtering out node_modules from everything right (tsconfig, eslint/biome, tailwind)?
Sang Dang
Sang DangOP•8mo ago
yes, I'm pretty sure I set it up to standard with correct ignores files my machine is 32GB ram and it took 2m
Siumauricio
Siumauricio•8mo ago
Can you show me your GitHub action? I'm pretty sure you are building the image in a wrong architecture I also have the same issue a few months ago with the image of dokploy itself, at the end I decided to split the builds in different architectures arm and amd github doesn't have arm runners yet, so if you are building a nextjs app it will go very slower
Sang Dang
Sang DangOP•8mo ago
omg you are right! I have both architecture in my github action and afte removing the unnecessary, it goes down to 6mins!!!

Did you find this page helpful?