wp-cron.php 을 매번 실행시켜야되는데… 그러면 cron이 필요하다.
supervisord 에 cron 을 물려서 하기에는 너무나도 귀찮은 면이 있기 때문에, 그냥 간단하게 처리했다.
Dockerfile
FROM wordpress:5-php7.4-apache
RUN apt-get update && apt-get -y install cron
ADD ./cron /etc/cron.d/php-cron
RUN chmod 0644 /etc/cron.d/php-cron
RUN sed -i -e 's/\r$//' /etc/cron.d/php-cron
RUN crontab /etc/cron.d/php-cron
# Create the log file to be able to run tail
RUN touch /var/log/cron.log
# Run the command on container startup
CMD cron && apache2-foreground
cron file
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*/15 * * * * php -q /var/www/html/wp-cron.php
이렇게 해결하였다. 현재, 아주 잘 작동되고 있다 ! GOOD (healthcheck는 안해둿음…)
15분마다 wp-cron.php 가 자동으로 돌아간다, 이미지 플러그인에서 잘 사용중이며, 15분마다 새로 업로드된 이미지를 압축처리하고 있다.