Container image size is a problem that needs to be fixed properly.
Some suggest using alpline distribution to save space.
This is basically a good suggestion, as there is a nodejs image for alpine that is ready to use.
But you have to be careful here because you need to collect all the binaries. Even _node_modules_ usually only contains javascript packages, in some cases you have a binary that needs to be created.
If your docker file is working right now, this should not be your business, but as you move from ubuntu to a different kind of image, it is better to keep in mind that all binaries that you need to use in the future should be compiled into alpine image.
He said that you should think about how you use your image before choosing where to reduce the size.
Is your application the only application that lives separately only in its own container without any other node application?
If the answer is no, you should know that the size of each image in the local docker registry does not count as a summary to get the total size used.
Instead, you need to split each image in the base layers and summarize each uniq layer.
I mean, one image is not that important if you have many node applications that run on node.
You can save space by splitting _node_modules_ by exporting it as a volume that contains all the necessary dependencies.
Or better, you can start with the official nodejs image to create an intermediate image containing the dependency root of your applications. For example expressjs and path. And then set the selected dependencies in each application image.
Thus, you get the advantage of sharing common layers, reducing the overall size of the local registry of local dockers.
Minor considerations
You do not need to set the express and the way around the world inside the container image.
Do you really need vim in the container? Note that modifying a container is unsafe even in development. You can use the volume to specify resources in the server file system. Or copy the file / folder from your container while you work. And if you just need to read something, just use commands like less, more or cat.