Setting up a python prod enviroment in an lx* container


(Mattias Hedman) #1

I am setting up an python prod enviroment inside an lxc container, now uwsgi “complains” that I am running it as root.

Following this guide: https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04

When I finnaly have setup the uwsgi service it complains aobut being runned as root, I try to change it to www-data as it group, uid=33 (www-data). Then the service fails.

Should I create a non-root user first and run everything from there instead?


#2

Yes, you need to have a non-root user as instructed in the guide.
Do you use LXD or LXC? With LXD, all images in the ubuntu: repository autocreate for you a non-root user with username ubuntu.