Minimal Docker runtime (#998)

* Minimal Docker runtime

Allow contributors work on the code without actual PHP8 on their computers.

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
This commit is contained in:
Grzegorz Korba 2021-10-13 14:54:13 +02:00 committed by GitHub
parent f5c1f19b54
commit 2acce0ab9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 1 deletions

3
.gitignore vendored
View File

@ -18,3 +18,6 @@ box.phar
php-parallel-lint
tmp
# Allow overrides for Docker configuration (custom volumes, env variables etc)
docker-compose.override.yml

View File

@ -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**

7
Dockerfile Normal file
View File

@ -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

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: "3.8"
services:
php:
build: .
volumes:
- .:/etc/rector