Skip to content

Commit

Permalink
Docker compose support (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmleroux authored Nov 15, 2017
1 parent 6e042df commit b62804b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/bin/php-cs-fixer
/bin/phpspec
/vendor
docker-compose.yml
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,25 @@ composer install
- Then run behat:

``` bash
./bin/behat run
./bin/behat
```

## Using Docker

We provide a `docker-compose.yml.dist` file to allow you to run tests in a Docker container.

```bash
cp docker-compose.yml.dist docker-compose.yml
docker-compose up -d
docker-compose exec fpm composer update
docker-compose exec fpm bin/phpspec run --format=pretty
docker-compose exec fpm bin/behat
```

The provided Docker compose file is for a PHP 7.1 environment, but you can modifiy it to use PHP 5.6.

See https://store.docker.com/community/images/jmleroux/fpm/tags

## License

[![License](https://poser.pugx.org/badges/poser/license.svg)](./LICENSE)
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2'

services:
fpm:
image: jmleroux/fpm:php-latest
environment:
COMPOSER_HOME: /home/docker/.composer
PHP_IDE_CONFIG: 'serverName=jmleroux-cli'
PHP_XDEBUG_ENABLED: 0
PHP_XDEBUG_IDE_KEY: XDEBUG_IDE_KEY
PHP_XDEBUG_REMOTE_HOST: xxx.xxx.xxx.xxx
XDEBUG_CONFIG: 'remote_host=xxx.xxx.xxx.xxx'
user: docker
volumes:
- ./:/srv/jmleroux
- ~/.composer:/home/docker/.composer
working_dir: /srv/jmleroux

0 comments on commit b62804b

Please sign in to comment.