This is one reason why I avoid Next.js. Don't design your future projects around specific platforms. Things happen. Make sure you can pick up your code and go somewhere else.
Edit: Strange I would get so many downvotes for this. Care to explain? I think the effective Next.js lock-in is well documented. Yeah you can technically run it on arbitrary platforms with substantial work and continued maintenance, but you're working against the tide.
I agree. There are too many platforms these days that support just uploading a Docker container. You can take those anywhere.
Next.js was once very useful to me, and now I am converting all my projects to Open NextJs.