From bffeb6e9f42fbf59a63f7acc1d997ee14261cbbb Mon Sep 17 00:00:00 2001 From: Jose Pablo Domingo Aramburo Sanchez Date: Tue, 7 Aug 2018 17:31:02 -0600 Subject: [PATCH] [add] Dockerfile --- api-payroll/Dockerfile | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 api-payroll/Dockerfile diff --git a/api-payroll/Dockerfile b/api-payroll/Dockerfile new file mode 100644 index 0000000..d4fdc8f --- /dev/null +++ b/api-payroll/Dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:16.04 + +# Updating +RUN apt-get -y update && apt-get -y upgrade + +# Installing php, apache and supplementary software +RUN apt-get -y install apache2 php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip curl git unzip composer + +# Enable apache mods +RUN a2enmod php7.0 +RUN a2enmod rewrite + +# Update the PHP.ini file, enable tags and quieten logging +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 + +# Manually set up the apache environment variables +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 + +# Expose apache +EXPOSE 80 + +# Copy this repo into place. +ADD . /var/www/site +WORKDIR /var/www/site + +# Testing permisions +RUN chmod 777 -R . + +# Installing dependencies +RUN composer install + +# Unit tests +RUN composer test + +# Update the default apache site with the config we created. +ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf + +# By default start up apache in the foreground, override with /bin/bash for interative +CMD /usr/sbin/apache2ctl -D FOREGROUND