nickjj / docker-django-example

A production ready example Django app that's using Docker and Docker Compose.
MIT License
1.17k stars 249 forks source link

Running as root? #3

Closed jensenbox closed 3 years ago

jensenbox commented 3 years ago

Is there any concern that the primary container is running as root? I know it is a container but I have heard that it is good practice to run as a non-root user.

nickjj commented 3 years ago

Hi, it's not running as the root user. It gets switched to the python user.

jensenbox commented 3 years ago

Yeah I finally saw that. Running as the Python user made my eyes glance over it and not see it..

Total nitpick but perhaps change the user to something like application instead of Python or something else that would stand out a little bit more. Not a big deal though.

On Wed., Jun. 2, 2021, 3:15 a.m. Nick Janetakis, @.***> wrote:

Hi, it's not running as the root user. It gets switched to the python user.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/nickjj/docker-django-example/issues/3#issuecomment-852903929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOGUKVEXMYJLMGATFW6BDTQYAEVANCNFSM456AML4Q .

nickjj commented 3 years ago

Thanks, I went with python because it's something most official Docker images use as a naming convention. When they include a user created in the image, it's with the name of the image itself.

If you head to https://nickjanetakis.com/blog/best-practices-around-production-ready-web-apps-with-docker-compose and search for "I chose python" you'll find a paragraph of text going into detail about this.