Is it necessary to install nginx in front of docker?

You need a web server on the host to serve Discourse in the container, even though nginx is installed in the container too. Nginx is suggested for the host too.

As for your plans, check out this post I made about this subject. Included is a ready-made nginx server block file.