shinsenter / php

📦 Simplified PHP Docker images for effortless customization and extension setup. Our Docker images cover PHP versions from 5.6 to 8.4, available in CLI, ZTS, FPM, FPM/Apache2, FPM/Nginx, RoadRunner, FrankenPHP, and Nginx Unit variants, for both Debian and Alpine versions. Updated everyday.
https://hub.docker.com/r/shinsenter/php
GNU General Public License v3.0
165 stars 26 forks source link

how to run nginx with root? #139

Closed zhangchunsheng closed 3 months ago

zhangchunsheng commented 3 months ago

The nginx user is www-data not root.

www-data 424 412 0 13:10 ? 00:00:00 nginx: worker process www-data 425 412 0 13:10 ? 00:00:00 nginx: worker process

shinsenter commented 3 months ago

@zhangchunsheng

The master process of Nginx always runs as the root user; however, its child processes will run under the user and group defined by the environment variables $APP_USER and $APP_GROUP (by default, APP_USER=www-data and APP_GROUP=www-data). To change the user and group, please modify these two environment variables when you start the container.

More details: https://github.com/shinsenter/php/blob/main/README.md#customizing-container-user-and-group-in-docker