espocrm / espocrm-docker

Official Docker Image for EspoCRM
https://hub.docker.com/r/espocrm/espocrm
GNU Affero General Public License v3.0
56 stars 34 forks source link

About Scheduled Jobs #43

Closed qiaofeng1227 closed 2 months ago

qiaofeng1227 commented 2 months ago

【Add this line to the crontab file to run Espo Scheduled Jobs】:What does this note mean?

Is it for me to manually add [ * cd /var/www/html; /usr/local/bin/php -f cron.php > /dev/null 2>&1] in the crontab of the operating system?

Or it has no other meaning, just an example。

qiaofeng1227 commented 2 months ago

image

lazespo commented 2 months ago

This line indicates the location of the file responsible for the cron performance.

In general, there are two options for running a cron for EspoCRM in a Docker environment:

  1. Using the espocrm-daemon container. The most convenient way to use it is in a docker-compose.yml file, which is presented here. Example:
 espocrm-daemon:
    image: espocrm/espocrm
    container_name: espocrm-daemon
    volumes:
      - espocrm:/var/www/html
    restart: always
    depends_on:
      - espocrm
    entrypoint: docker-daemon.sh
  1. Adding the following line to the crontab as a root user:
* * * * * /usr/bin/docker exec --user www-data -i espocrm /bin/bash -c "cd /var/www/html; /usr/local/bin/php -f cron.php" > /dev/null 2>&1