Docker build error
Hello all, i tried to build a docker image of my T3 stack app (+ trpc-to-openapi). I think that i did everything correctly but i keep getting the same error (only with docker build, not with npm run build) that i don't understand. Here is my Dockerfile (based on example) and the error: https://pastebin.com/L9jf3zc8 Thank you for your help!
Pastebin
T3 docker build - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
1 Reply
The problem is about collecting page data. Next.js prenders static pages during build, so it needs to connect to some service that you get data from to render them. From my understanding docker does not have access to external network during build so it cannot connect anywhere, so it cannot bulild routes. Solution? Leave Docker away and don't use it or make all pages dynamic so nextjs won't prerender them during build. Maybe there is some other solution but I don't know about it