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 <cursoragent@cursor.com>
This commit is contained in:
2026-02-18 16:41:11 -08:00
parent efcf20b8f6
commit a8aefc0099

View File

@@ -2,6 +2,8 @@ node_modules
.next
.git
.gitignore
.env
.env.*
.env*.local
.DS_Store
*.log