dwchiang/nginx-php-fpm

Scripts in docker-entrypoint.d/ not running

Closed this issue · 1 comments

Hi,

First of all thanks for a great Docker image helper!

I'm using image dwchiang/nginx-php-fpm:7.4.9-fpm-buster-nginx-1.21.1 to host a WordPress website, and having trouble to get the docker-entrypoint scripts in /docker-entrypoint.d/ to run due to the if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then statement in https://github.com/dwchiang/nginx-php-fpm/blob/master/Dockerfiles/buster/Dockerfile-7.4.9-fpm-buster-nginx-1.21.1.

I wasn't sure how to pass that so ended up cloning the docker-entrypoint.sh file and removing the if-statement, and now the scripts are running (including my custom script copied to /docker-entrypoint.d/).
How can I get the if-statement to run without overriding the docker-entrypoint.sh file?

Also, I noticed that the file 30-tune-worker-processes.sh file is not writeable, seeing Ignoring /docker-entrypoint.d/30-tune-worker-processes.sh, not executable in the logs. Is that a mistake? The other scripts run fine.

Thanks!

Thanks for the feedback :)

I think the file 30-tune-worker-processes.sh file should be a mistake. The upstream did an updates on this file, so that it could be me did the updates but forget to double check the executable mode. I will update it in the next commit.

In theory, the scripts comes from nginx upstream, I only duplicate them without any modification...QQ

I haven't try this Docker image with Wordpress yet. Let me see if I can find some time to play with Wordpress this weekend.

Is it possible to know your use case with Wordpress? Are you trying to place one extra shell script file in the folder /docker-entrypoint.d/*.sh? Maybe you can try this file naming rule: {number}-{customName}.sh (e.g. 40-wordpress.sh). And also chmod 744 on the new added script file. And see if docker-entrypoint.sh will load the new added file.

Thanks for supporting this project :)