Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cron with user 1000 #90

Open
trebormc opened this issue Sep 22, 2019 · 0 comments
Open

Run cron with user 1000 #90

trebormc opened this issue Sep 22, 2019 · 0 comments

Comments

@trebormc
Copy link

trebormc commented Sep 22, 2019

My problem is that I need to run the Drupal cron for some websites on the development servers (run periodic imports or reindex the search_api for example).

I have tried to execute the cron in several ways, but I always end up getting the same fault.
After researching a few hours, I have seen that people who use Alpine say they use the root user (which I don't think is the best idea)

I have seen that you delete the root crontab, and only leave the user www-data. I think the problem comes from here, since drush should always be run as user 1000 (wodby), right?

rm /etc/crontabs/root; \

A possible solution would be to have both volumes:

  • /etc/crontabs/www-data
  • /etc/crontabs/wodby

My docker-compose:

    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_crond"
    command: sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0
    volumes:
      - ./app:/var/www/html
      - ./files:/mnt/files
      - ./crontab:/etc/crontabs/www-data

My crontab:

    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_crond"
    restart: always
    command: sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0
    volumes:
      - ./app:/var/www/html
      - ./files:/mnt/files
      - ./crontab:/etc/crontabs/www-data

I just want to have the cron running, and I'm starting with docker, maybe I'm wrong with the reason why it doesn't work. Any other idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant