Software⏱️ 2 min read📅 2026-05-29

How to Fix: Dokploy Nextjs Dockerfile not working in ISR

Passing environment variables to a Dockerfile in Dokploy for Next.js and Prisma integration.

Quick Answer: Use the `ARG` instruction to pass the `DATABASE_URL` variable to your Docker image, and then use it in your Next.js build process.

To resolve the issue of not passing the DATABASE_URL to Prisma during build time in your Next.js Dockerfile on Dokploy, you can use environment variables. Since you have already added the DATABASE_URL as a Build time secret, you can access it within your Dockerfile.

⚠️ Common Causes

  • Hardcoding the DATABASE_URL in the Dockerfile instead of using environment variables.

🚀 How to Resolve This Issue

Method 1: Using Environment Variables

  1. Step 1: In your Dockerfile, use the ARG keyword to define the DATABASE_URL as an argument.

Method 2: Accessing Build Time Secrets

  1. Step 1: In your Dockerfile, use the ENV keyword to set the DATABASE_URL environment variable.

🎯 Final Words

By using environment variables and accessing Build time secrets, you can resolve the issue of not passing the DATABASE_URL to Prisma during build time in your Next.js Dockerfile on Dokploy.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions