mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #651 from pestphp/docker_support
[2.x] Docker support for OSS contributors
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,4 +1,5 @@
|
||||
/art export-ignore
|
||||
/docker export-ignore
|
||||
/docs export-ignore
|
||||
/tests export-ignore
|
||||
/scripts export-ignore
|
||||
@ -11,5 +12,6 @@ phpstan.neon export-ignore
|
||||
/phpunit.xml export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
CONTRIBUTING.md export-ignore
|
||||
docker-compose.yml export-ignore
|
||||
README.md export-ignore
|
||||
|
||||
|
||||
@ -54,3 +54,22 @@ Integration tests:
|
||||
```bash
|
||||
composer test:integration
|
||||
```
|
||||
|
||||
## Simplified setup using Docker
|
||||
|
||||
If you have Docker installed, you can quickly get all dependencies for Pest in place using
|
||||
our Docker files. Assuming you have the repository cloned, you may run the following
|
||||
commands:
|
||||
|
||||
1. `docker compose build` to build the Docker image
|
||||
2. `docker compose run --rm composer install` to install Composer dependencies
|
||||
3. `docker compose run --rm composer test` to run the project tests and analysis tools
|
||||
|
||||
If you want to check things work against a specific version of PHP, you may include
|
||||
the `PHP` build argument when building the image:
|
||||
|
||||
```bash
|
||||
docker compose build --build-arg PHP=8.2
|
||||
```
|
||||
|
||||
The default PHP version will always be the lowest version of PHP supported by Pest.
|
||||
|
||||
14
docker-compose.yml
Normal file
14
docker-compose.yml
Normal file
@ -0,0 +1,14 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: ./docker
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
composer:
|
||||
build:
|
||||
context: ./docker
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
entrypoint: ["composer"]
|
||||
19
docker/Dockerfile
Normal file
19
docker/Dockerfile
Normal file
@ -0,0 +1,19 @@
|
||||
ARG PHP=8.1
|
||||
FROM php:${PHP}-cli-alpine
|
||||
|
||||
RUN apk update \
|
||||
&& apk add zip libzip-dev icu-dev
|
||||
|
||||
RUN docker-php-ext-configure zip
|
||||
RUN docker-php-ext-install zip
|
||||
RUN docker-php-ext-enable zip
|
||||
|
||||
RUN docker-php-ext-configure intl
|
||||
RUN docker-php-ext-install intl
|
||||
RUN docker-php-ext-enable intl
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENTRYPOINT ["php"]
|
||||
Reference in New Issue
Block a user