From a8aefc00994a2935663eb4c9fa61a9c7942e446a Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Wed, 18 Feb 2026 16:41:11 -0800 Subject: [PATCH] fix: exclude .env files from Docker build context Coolify writes a .env file into the build context directory which gets COPY'd into the builder container. Next.js then loads these env vars (including DATABASE_URL, GITEA_API_TOKEN etc.) during the build, causing some routes that reference those vars to fail static analysis and be silently dropped from the build output. Exclude all .env* files from the Docker build context so the Next.js build runs with only the vars explicitly passed as build args or set in the Dockerfile. Co-authored-by: Cursor --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index 290aba7..cb0735e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,8 @@ node_modules .next .git .gitignore +.env +.env.* .env*.local .DS_Store *.log