diff --git a/.gitignore b/.gitignore index 4cd6c70598f..cd63a486d82 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ box.phar php-parallel-lint tmp + +# Allow overrides for Docker configuration (custom volumes, env variables etc) +docker-compose.override.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 596ea9dc89f..8f674765fd0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,20 @@ Contributions here are more than welcomed! You can contribute to [rector-src](https://github.com/rectorphp/rector-src) repository. -There 3 rules will highly increase changes to get your PR merged: +### Preparing Local Environment + +If you have PHP 8 and Composer installed locally you can use it straight away. You can validate your environment with: + +```bash +composer check-platform-reqs + +Alternatively you can use Docker runtime. All you need to do is wrap every command with `docker-compose run php`, so commands will be executed inside Docker container. + +For example `docker-compose run php composer install` will download PHP dependencies, so you can start using all scripts and work with the code. + +### Preparing Pull Request + +There 3 rules will highly increase chance to get your PR merged: - **1 feature per pull-request** - **new features need tests** diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..d4de7e2063c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM php:8-cli-alpine + +WORKDIR /etc/rector + +COPY --from=composer:2 /usr/bin/composer /usr/bin/composer + +RUN mkdir -p /etc/rector diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..84504daf86e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.8" + +services: + php: + build: . + volumes: + - .:/etc/rector