DokployD
Dokploy2y ago
18 replies
remib18

NextJS build issue

Hello !

I've been playing around with Dokploy to test its capabilities, and so far, I'm quite impressed.

I'm currently building a test NextJS application. It was working fine after some trial and error, but suddenly, NextJS seems to be skipping the build process...

#12 [8/8] RUN pnpm run build
#12 5.335 
#12 5.335 > urbex-next@0.1.0 build /app
#12 5.335 > next build
#12 12.22 
#12 13.04   ▲ Next.js 14.2.5
#12 13.04   - Environments: .env
#12 13.04 
#12 13.75    Creating an optimized production build ...
#12 DONE 34.4s

#13 exporting to image
#13 exporting layers
#13 exporting layers 5.9s done
#13 writing image sha256:5e66a251337e7956ca7a956018758b154f63984fff9e9d6519d5184c83e32272 0.0s done
#13 naming to docker.io/library/website-frontend-062bee
#13 naming to docker.io/library/website-frontend-062bee 0.2s done
#13 DONE 6.4s
Docker Deployed: ✅


As a result, the next start command isn't working:
> next start

  ▲ Next.js 14.2.5
  - Local:        http://localhost:3000

 ✓ Starting...
Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
    at setupFsCheck (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-utils/filesystem.js:151:19)
    at async initialize (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:61:23)
    at async Server.<anonymous> (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:249:36)
 ELIFECYCLE  Command failed with exit code 1.


For reference, here's an example of the expected log output on my local machine:

I've tried pruning all Docker volumes, images, containers, and build cache, but the issue persists. :/

Thanks in advance for your help!
Was this page helpful?