diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc36280 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:16.04 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + curl git zip php php-dom php-curl php-common php-xdebug\ +&& apt-get clean + +# * * * * * * * * * install composer +RUN curl --silent --show-error https://getcomposer.org/installer | php && mv /composer.phar /usr/local/bin/composer + +# * * * * * * * * * clean up +RUN rm -r /var/lib/apt/lists/* + +ADD . /app + +WORKDIR /app + +RUN composer install + +CMD ["vendor/bin/phpunit"] diff --git a/README.md b/README.md index 152f37e..a2d9293 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,16 @@ Run the tests ``` ./vendor/bin/phpunit ``` + +## Use Docker for testing +We provide a Dockerfile with Ubuntu 16.04 and PHP7 +Start testing via the following: +``` +docker build -t sofortlib . +docker run -ti -v $(pwd):/app sofortlib bash -c "composer install && vendor/bin/phpunit" +``` + +## Use Docker to run examples +``` +docker run -ti -v $(pwd):/app sofortlib bash -c "php examples/Paycode.php" +``` \ No newline at end of file