PrismaP
Prisma3mo ago
6 replies
beanbeanjuice

Missing required environment variable: DATABASE_URL in GitHub CI for generate

Locally, I can build my docker image fine. But in the GitHub CI pipeline, I run into the error in the title.

However, this is a DOCKER image, I don't want to hard-code the DATABASE_URL.

import 'dotenv/config';
import path from "node:path";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
    schema: path.join("prisma", "schema.prisma"),
    migrations: {
        path: path.join("prisma", "migrations"),
        // seed: 'ts-node -r tsconfig-paths/register prisma/seed.ts'
        seed: 'node prisma/seed.js' // for dev, use npm run prisma:seed
    },
    engine: "classic",
    datasource: {
        url: env('DATABASE_URL'),
    }
});


Shouldn't it be grabbing it from the environment variables? Why does it need the database_url for npx prisma generate?
Was this page helpful?