1234567891011121314151617181920212223242526272829303132 |
- FROM ubuntu:bionic
- RUN apt-get update && \
- apt-get -y upgrade && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install \
- apache2 php7.2 libapache2-mod-php7.2 curl cron git
- RUN a2enmod php7.2
- #RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini
- #RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini
- ENV APACHE_RUN_USER www-data
- ENV APACHE_RUN_GROUP www-data
- ENV APACHE_LOG_DIR /var/log/apache2
- ENV APACHE_LOCK_DIR /var/lock/apache2
- ENV APACHE_PID_FILE /var/run/apache2.pid
- RUN touch /var/log/cron.log
- RUN (crontab -l ; echo "* * * * * cd /var/www/html && php poll_adei_data.php >> /var/log/cron.log") | crontab
- RUN (crontab -l ; echo "* * * * * cd /var/www/html && php poll_HV_data.php >> /var/log/cron.log") | crontab
- ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
- RUN rm -rf /var/www/html/*
- ADD . /var/www/html
- RUN chown -R www-data:www-data /var/www/html
- EXPOSE 80
- WORKDIR /var/www/html
- CMD cron && apache2ctl -D FOREGROUND
|