openfaas / python-flask-template

HTTP and Flask-based OpenFaaS templates for Python 3
MIT License
85 stars 86 forks source link

Non-root users for all templates #21

Closed burtonr closed 5 years ago

burtonr commented 5 years ago

Update all python-flask templates to use a non-root user

Signed-off-by: Burton Rheutan rheutan7@gmail.com

Tested by exec-ing into the containers and verifying the user and directory. Then, executing a curl command to ensure the function was still functioning (unable to test/verify the arm template as I do not at the moment have access to and arm device)

$ docker run -it python27-flask:test /bin/sh
~ $ ls
function          index.py          requirements.txt
~ $ pwd
/home/app
~ $ whoami
app
$ docker run -it python3-flask:test /bin/sh
~ $ ls
function          index.py          requirements.txt
~ $ pwd
/home/app
~ $ whoami
app