You are using --mount=type=secret. And your npm run build command didn't see your /run/secrets/ folder. Don't use secrets in build step. Use environment variables at runtime: ENV NEXTAUTH_SECRET=$NEXT_PUBLIC_PLACEHOLDER_SECRET
--mount=type=secret
npm run build
ENV NEXTAUTH_SECRET=$NEXT_PUBLIC_PLACEHOLDER_SECRET