I see a lot of negative comments. It's true, this article is full of holes, however it still got recommended by Medium because it received a lot of eyes. I was going to add a negative comment as well, but would it better to see articles as a start of a conversation instead as a source of truth.
So for this conversation starter, I would say you don't need a docker file (at least in AWS, that magic is done for you on their end). You can create a serverless method in seconds with just source code*
However, you would need to level up and put all the other tools together like connecting to a database or sending e-mail using a serverless function. It get's pretty complicated quickly.
So I would not tell a beginner developer to get into it. It's just harder to debug . But a junior developer should be able to learn and figure it out.
*I recommend using serverless. It makes things "easy". https://www.serverless.com/learn/