Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit ce821cd

Browse files
committed
Add cron job
1 parent d414b6b commit ce821cd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build/php-apache/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ ENV LOCALE9="pt_PT.UTF-8"
1111
ENV LOCALE10="ru_RU.UTF-8"
1212
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
1313
RUN apt-get update \
14-
&& apt-get install -y curl gettext git libxml2 libxml2-dev locales tzdata \
14+
&& apt-get install -y cron curl gettext git libxml2 libxml2-dev locales tzdata \
1515
&& apt-get clean -y \
1616
&& docker-php-ext-install gettext mysqli pdo pdo_mysql simplexml
1717
RUN cp /usr/share/zoneinfo/America/Vancouver /etc/localtime \
1818
&& echo "America/Vancouver" > /etc/timezone
1919
COPY php.ini-production /usr/local/etc/php/php.ini
20+
COPY cron /etc/cron.d/cron
21+
RUN chmod 0644 /etc/cron.d/cron
22+
RUN crontab /etc/cron.d/cron
23+
RUN mkdir -p /var/log/cron
24+
RUN sed -i 's/^exec /service cron start\n\nexec /' /usr/local/bin/apache2-foreground
2025
RUN sed -i -e "s/# $LOCALE1/$LOCALE1/" /etc/locale.gen
2126
RUN sed -i -e "s/# $LOCALE2/$LOCALE2/" /etc/locale.gen
2227
RUN sed -i -e "s/# $LOCALE3/$LOCALE3/" /etc/locale.gen

build/php-apache/cron

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/10 * * * * www-data /usr/local/bin/php -q /var/www/html/cron.php > /dev/null

0 commit comments

Comments
 (0)