I fixed my own issue. Apparently some install scripts fail when run as root (or with sudo). I'm not sure why this is the case, but I got everything to work by running sudo chown -R ralph:www-data /path/to/nodebb && ./nodebb upgrade as a standard user.
I see that I had to execute ./nodebb build in the container. I am guessing that it is because after removing the container, the build directory was gone and needed to be rebuilt, which tells me I have to put a build command on every container startup. This is not very optimal. I am hoping at some point in the future we can have a more hands-off docker-friendly deployment (like with env vars and all).