Add cron job to docker file.

This commit is contained in:
James Cole 2018-07-03 06:03:38 +02:00
parent 0fa4d75a47
commit 53addcf99a

View File

@ -23,6 +23,7 @@ RUN apt-get update -y && \
libpq-dev \
libbz2-dev \
gettext-base \
cron \
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
@ -47,6 +48,13 @@ RUN cd /tmp && \
make && \
make install
# Create the log file to be able to run tail
RUN touch /var/log/cron.log
# Setup cron job
RUN (crontab -l ; echo "* * * * * root $FIREFLY_PATH/artisan schedule:run >> /var/log/cron.log") | crontab
# Install PHP exentions.
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
@ -77,6 +85,9 @@ RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
# Expose port 80
EXPOSE 80
# Run the command on container startup
CMD cron
# Run entrypoint thing
ENTRYPOINT [".deploy/docker/entrypoint.sh"]