Non-Zero Exit when deploying NestJS in App Containers

Posted September 11, 2021 275 views
Node.jsDigitalOcean Managed MySQL DatabaseDigitalOcean App Platform

I want to deploy my NestJS in DigitalOcean App Containers. I have Database running in DigitalOcean and I want to point my NestJS to that Database. I use this following configuration:

Build script: npm run build <cross-env NODE_ENV=production nest build>
Run script: npm run start:prod <node dist/src/main>

I have specified my DigitalOcean Database in app spec env too. When building the app, it stuck on Downloading and Extracting Node v14.17.6 and stopping after some time stating Build Error: Non-Zero Exit. Can someone provide me guidance? Or something like that? Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey there!

Are you setting those run and build scripts as the build and run commands in app platform when creating your application? You may need to set those as the build and run commands in the app platform UI when creating the application. That should help run the build correctly.

Build and Run Commands

Hope it helps!