diff --git a/build/php/Dockerfile b/build/php/Dockerfile index fa2c97e..7c4e76d 100644 --- a/build/php/Dockerfile +++ b/build/php/Dockerfile @@ -1,28 +1,32 @@ FROM ubuntu:16.04 -MAINTAINER Chris Fidao +LABEL MAINTAINER="Chris Fidao" +RUN apt-get update \ + && apt-get install -y locales RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -RUN apt-get update \ - - && apt-get install -y curl zip unzip git software-properties-common \ +RUN apt-get install -y curl zip unzip git software-properties-common wget \ && add-apt-repository -y ppa:ondrej/php \ && apt-get update \ - && apt-get install -y php7.0-fpm php7.0-cli php7.0-mcrypt php7.0-gd php7.0-mysql \ - php7.0-pgsql php7.0-imap php-memcached php7.0-mbstring php7.0-xml php7.0-curl \ + && apt-get install -y php7.1-fpm php7.1-cli php7.1-mcrypt php7.1-gd php7.1-mysql \ + php7.1-pgsql php7.1-imap php-memcached php7.1-mbstring php7.1-xml php7.1-curl \ && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ && mkdir /run/php \ && apt-get remove -y --purge software-properties-common \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -ADD php-fpm.conf /etc/php/7.0/fpm/php-fpm.conf -ADD www.conf /etc/php/7.0/fpm/pool.d/www.conf +RUN wget https://phar.phpunit.de/phpunit-6.2.phar \ + && chmod +x phpunit-6.2.phar \ + && mv phpunit-6.2.phar /usr/local/bin/phpunit + +ADD php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf +ADD www.conf /etc/php/7.1/fpm/pool.d/www.conf EXPOSE 9000 -CMD ["php-fpm7.0"] +CMD ["php-fpm7.1"] diff --git a/build/php/php-fpm.conf b/build/php/php-fpm.conf index 53de9e2..33112fb 100644 --- a/build/php/php-fpm.conf +++ b/build/php/php-fpm.conf @@ -14,7 +14,7 @@ ; Pid file ; Note: the default prefix is /var ; Default Value: none -pid = /run/php/php7.0-fpm.pid +pid = /run/php/php7.1-fpm.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written @@ -122,4 +122,4 @@ daemonize = no ; Relative path can also be used. They will be prefixed by: ; - the global prefix if it's been set (-p argument) ; - /usr otherwise -include=/etc/php/7.0/fpm/pool.d/*.conf +include=/etc/php/7.1/fpm/pool.d/*.conf diff --git a/readme.md b/readme.md index 3c1db56..0c15e67 100644 --- a/readme.md +++ b/readme.md @@ -109,6 +109,21 @@ docker run -it --rm \ php artisan migrate ``` +### 4. (Optionally) Use PHPUnit: + +First, be sure the newest shippingdocker/php image has been build, you need it to use PHPUnit. + +Now just use the command as known: + +```bash +docker run -it --rm \ + -v $(pwd)/application:/opt \ + -w /opt \ + --network=phpapp_appnet \ + shippingdocker/php \ + phpunit +``` + Now we can start using our application! Head to `http://localhost/register` to see your Laravel application with auth scaffolding in place. ![image](https://cloud.githubusercontent.com/assets/467411/18038743/6ac84008-6d61-11e6-8aa6-30a776b59aaa.png)