Add Docker files and documentation

This commit is contained in:
jmleroux 2021-11-11 00:17:36 +01:00
parent 9533accd73
commit e61261fc74
3 changed files with 33 additions and 0 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM php:7.2-cli
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libzip-dev \
locales \
locales-all \
zip \
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

View File

@ -40,6 +40,19 @@ For information, the performance tests take about 10 minutes to run (processing
> Performance tests status: [![Build Status](https://travis-ci.org/box/spout.svg?branch=perf-tests)](https://travis-ci.org/box/spout)
### Running test with Docker
First install the dependencies with docker-compose
```bash
docker-compose run --rm -u ${UID} php composer install
```
Then launch the tests
```bash
docker-compose run --rm php vendor/bin/phpunit
```
## Support

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3'
services:
php:
build: .
working_dir: /srv/spout
volumes:
- $PWD:/srv/spout
- $PWD/tests/generated/resources/unwritable:/srv/spout/tests/resources/generated/unwritable:ro