wuvt / wuvt-site

Website including a CMS, playlist information, and donation management tools
https://www.wuvt.vt.edu
GNU Affero General Public License v3.0
11 stars 12 forks source link

Pre-create redis user to avoid uwsgi using the wrong uid/gid. #346

Closed mstathers closed 5 years ago

mstathers commented 5 years ago

I noticed when attempting to start the dev docker container the site wouldn't come up and there were quite a few redis errors in the console.

I tracked the issue down to uwsgi trying to run the daemon with the incorrect uid/gid: https://github.com/wuvt/wuvt-site/blob/master/uwsgi_docker.ini#L44

Looking at the history of that file, it looks like the uid/gid had been changed a few times - perhaps a bit of a bandaid patch.

There were a few possible solutions. 1) Change the uid/gid used again. In my fresh docker container they were uid=101 and gid=102, if my memory serves. 2) Remove the uid/gid options and just have redis run as root. 3) Pre-create a redis user and group with a high enough uid/gid that we would not risk clobbering it again.

This PR employs the third option as I think it is the most elegant.

Thanks

mutantmonkey commented 5 years ago

Thanks!