From cd66daa6b181ecdde71c391190c1c7880f7b239b Mon Sep 17 00:00:00 2001 From: "Najjar\\NajjarV02" Date: Fri, 22 May 2026 11:16:29 +0400 Subject: [PATCH] fix(deploy): force dev deps in Docker deps stage; commit prod NEXT_PUBLIC_* Coolify injects NODE_ENV=production at build time, causing `pnpm install --frozen-lockfile` to skip devDependencies. Next.js build then fails on missing @tailwindcss/postcss. Override NODE_ENV=development and pass --prod=false for the install step only. Builder stage still runs `next build` with NODE_ENV=production, which is the intended runtime mode. Also commits apps/dashboard/.env.production with public URLs so Next.js bakes NEXT_PUBLIC_* into the bundle at build time (Coolify API rejects the is_build_time flag, so we can't mark them runtime). --- Dockerfile | 4 +++- apps/dashboard/.env.production | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 apps/dashboard/.env.production diff --git a/Dockerfile b/Dockerfile index a9a2759..41ed561 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,9 @@ COPY packages/api/package.json ./packages/api/ COPY packages/ui/package.json ./packages/ui/ COPY packages/eslint-config/package.json ./packages/eslint-config/ COPY packages/typescript-config/package.json ./packages/typescript-config/ -RUN pnpm install --frozen-lockfile +# Force dev deps even when Coolify injects NODE_ENV=production at build time. +# Tailwind / postcss / next types are devDependencies — required by `next build`. +RUN NODE_ENV=development pnpm install --frozen-lockfile --prod=false # ──────────────────────────────────────────────────────────── # Stage 3: builder — build dashboard with standalone output diff --git a/apps/dashboard/.env.production b/apps/dashboard/.env.production new file mode 100644 index 0000000..9682bbc --- /dev/null +++ b/apps/dashboard/.env.production @@ -0,0 +1,6 @@ +# Committed prod env — Next.js bakes NEXT_PUBLIC_* into the bundle at build time. +# Only public URLs here. Secrets stay in Coolify env vars (runtime). + +NEXT_PUBLIC_API_URL=https://api.reparee.com +NEXT_PUBLIC_SAAS_URL=https://reparee.com +NEXT_PUBLIC_GARAGE_HOST_PATTERN=*.reparee.com