From 80186a13951ae6688392b4e6f533f7a5b6372184 Mon Sep 17 00:00:00 2001 From: Radoslaw Ziemniewicz Date: Sun, 8 Aug 2021 21:13:49 +0100 Subject: [PATCH] Added Docker configuration --- .gitignore | 3 ++- Dockerfile | 6 ++++++ README.md | 6 +++++- composer.json | 30 ++++++++++++++++++++++++++++++ docker-compose.yml | 8 ++++++++ src/Dumper.php | 8 ++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 composer.json create mode 100644 docker-compose.yml create mode 100644 src/Dumper.php diff --git a/.gitignore b/.gitignore index a67d42b..6fb7545 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ composer.phar +composer.lock /vendor/ - +.idea # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file # composer.lock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..502d2b3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM php:8-cli-alpine +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" +RUN php composer-setup.php +RUN php -r "unlink('composer-setup.php');" +RUN mv composer.phar /usr/local/bin/composer diff --git a/README.md b/README.md index 4f938cd..98a3039 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -# dumper \ No newline at end of file +# dumper + +```shell +$ docker exec -w /var/www/html -it quillstack_dumper sh +``` \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..12b019b --- /dev/null +++ b/composer.json @@ -0,0 +1,30 @@ +{ + "description": "Variables dumper library.", + "type": "library", + "license": "MIT", + "keywords": [ + "variables", + "dumper", + "export", + "php8" + ], + "homepage": "https://quillstack.org/dumper", + "authors": [ + { + "name": "Radek Ziemniewicz", + "email": "radek@quillstack.org" + } + ], + "require": { + "php": "^8.0" + }, + "autoload": { + "psr-4": { + "QuillStack\\Dumper\\": "src/", + "QuillStack\\Tests\\Dumper\\": "tests/" + } + }, + "require-dev": { + "phpunit/phpunit": "^9" + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a66374d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' +services: + php: + build: . + container_name: quillstack_dumper + tty: true + volumes: + - .:/var/www/html \ No newline at end of file diff --git a/src/Dumper.php b/src/Dumper.php new file mode 100644 index 0000000..00b6af4 --- /dev/null +++ b/src/Dumper.php @@ -0,0 +1,8 @@ +