I’m dockerizing a nextjs application to host it on a ‘custom’ cloud provider (not vercel). During development I’m still using the postgresSQL of vercel. The postgresSQL of the new cloud provider is not accessible directly from the internet but only within the intranet. Therefore I need to change the connectionstring during deployment. I found out that the .env file is twice available and I overwrite them both after the nextjs build. But at runtime my app is still using the old connectionstring. But I cannot find its location.
This is the overwrite of the both env-files. The overwrite during docker build is required since nextJS-build requires an existing connection during build.
COPY --from=builder --chown=nextjs:nodejs /app/.env-hosting ./.next/standalone/.env
COPY --from=builder --chown=nextjs:nodejs /app/.env-hosting ./.env
Situation is same locally in docker as hosted on the new cloud provider.
I also downloaded the app-directory from the docker image and search for any term of my connectionstring but couldn’t find anything.
What do I miss?