Start here. This is the direct spoken answer to practice first.
Why this question matters
I would run the application as a non-root user and give it only the filesystem and network permissions it actually needs. A container boundary does not make root inside the container harmless.
The image creates or uses a dedicated application user, copies published files with correct ownership, and listens on an unprivileged port such as 8080. Writable paths are explicit for temporary files or caches, while the application directory can remain read-only. I prefer a supported minimal runtime base and keep shells, compilers, and package managers out of the final stage unless an operational need justifies them.