This is my first insight
First of all you need to create next app with the configuration you like.
npx create-next-app@latest
After that you have to add several files for Docker configuration.
I like to use module exports for Next js config. And here is how you can do it:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
};
export default nextConfig;
After that you have to add some configuration for docker files: