Are you sure the issue is with nginx? Did you ever go into a docker container directly and muck with nginx? If you only messed with things outside the container, it would perhaps be best to figure out what happened and correct it. If you really want to delete it all, make a backup first if you have a live forum with content. You can simply ssh into your instance and perform these commands to wipe it all out:
Always quote anything containing asterisks or the shell might replace it with a matching filename.
Also, the data is stored in /var/discourse and it might not delete any images or containers docker has created or downloaded; those should live in /var/lib/docker, but that’s a blind guess. (They’d not hinder or affect a new installation anyway, just fill up some disk space.)
And does apt-get know that it needs to stop containers and the docker daemon itself before uninstalling the package?
As I said, I have no idea what apt-get does in this case. Sure, it can certainly delete all the files, but quite a few processes might keep running until you manually kill them or reboot… and if the docker daemon is still listening on port 80, you’d run into errors if you tried to install a different webserver or reinstall docker and Discourse.