From c0e1d321aaed5b19a23141a033e1e3b105ec9c8b Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 7 Jun 2017 08:23:20 +0200 Subject: [PATCH 1/3] added Dockerfile and README.md --- Dockerfile | 19 +++++++++++++++++++ README.md | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20a5201 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get install -y \ + curl git zip php php-dom php-curl php-common php-xdebug php-intl\ +&& 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"] \ No newline at end of file diff --git a/README.md b/README.md index 152f37e..8309865 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,11 @@ 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" +``` \ No newline at end of file From 70c55ddb143aaec0f1fcaeca6cfdb8b54795b90e Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 7 Jun 2017 08:24:43 +0200 Subject: [PATCH 2/3] run examples via Docker --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 8309865..a2d9293 100644 --- a/README.md +++ b/README.md @@ -76,4 +76,9 @@ 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 From 0676e687b681c965ff426ae2e66523c09067837e Mon Sep 17 00:00:00 2001 From: Florian Dehn Date: Thu, 8 Jun 2017 11:10:46 +0200 Subject: [PATCH 3/3] debian frontend noninteractive added --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 20a5201..cc36280 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y \ - curl git zip php php-dom php-curl php-common php-xdebug php-intl\ +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 @@ -16,4 +16,4 @@ WORKDIR /app RUN composer install -CMD ["vendor/bin/phpunit"] \ No newline at end of file +CMD ["vendor/bin/phpunit"]