Run as non-root, always
By default, processes inside a container run as root. If your app has a vulnerability and an attacker breaks out of the namespace, they're root on the host. Creating a system user and switching to it before CMD costs two lines and removes that escalation path.
Resource limits prevent noisy neighbors
--memory and --cpus tell the kernel how much your container is allowed. Without them, a buggy container can OOM the host, taking everything else down with it.