1.4 KiB
cron service (Docker)
The cron image runs a single job: php bin/console app:prewarm every 10 minutes, against the app tree bind-mounted at /var/www/html. Magazine 30040 indices, MySQL backfill for category a long-form rows, profile metadata, and comment cache are updated here (or by running app:prewarm manually)—not from a browser request.
-
Flags: set
PREWARM_FLAGSin the project.env(Compose injects it). Example:PREWARM_FLAGS="--metadata-limit=30 --no-magazine". After editing, rundocker compose up -d --force-recreate cron(ordocker compose up -d cron) so the container gets the new value. If unset,app:prewarmuses its built-in defaults (same idea as running the console with no args). -
How env reaches cron: the entrypoint writes
PREWARM_FLAGSto/run/cron-prewarm.envat boot, because the systemcronddoes not pass the container environment into crontab jobs. -
Logs inside the container:
tail -f /var/log/cron.log(e.g.docker compose exec cron tail -f /var/log/cron.log). -
PHP 8.3 extensions in the image are limited to what
app:prewarmneeds; the host vendor tree is what you mount from the repo. -
Not included in
compose.hub.yaml(no app source mount). For production images, use host cron / systemd toexecthe same command.
Change the schedule: edit docker/cron/crontab, then docker compose build cron && docker compose up -d cron.