thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
785 stars 138 forks source link

CRON_USER variable defaults to root when not set #297

Closed WillyReyno closed 2 years ago

WillyReyno commented 2 years ago

Expected Behavior / Current Behavior

When CRON_USER variable is not set in the docker-compose file, it automatically fallbacks to root, where we should expect it to fall back to the current user and not root.

Steps to Reproduce (for bugs)

  1. Don't define a CRON_USER in your docker-compose
  2. Notice that all CRON tasks are run as root

Context

I deployed a Laravel app recently, where an exception was triggered regularly and creating the logs file by default. That's when I noticed the log files were owned by root instead of the container user.

mistraloz commented 2 years ago

Hello Willy. root it's the only one user who exist in any case so it's easier like that. And it's on documentation :

# configure the user that will run cron (defaults to root)
CRON_USER=root

In addition, it's will be a breaking change if we change that. If you want, we can speak about that for a V5 (but the most secure way maybe to generate an error when no cron user was specified).

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not had recent activity. Please, reopen if you need.