Skip to content

Commit

Permalink
Merge pull request #69 from smokills/feature/docker
Browse files Browse the repository at this point in the history
dockerized
  • Loading branch information
nunomaduro authored May 17, 2019
2 parents 0ab7491 + 72611d6 commit 2e98ebf
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.styleci.yml
.travis.yml
.editorconfig
.gitattributes
.editorconfig
.all-contributorsrc
phpunit.xml.dist
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
README.md
/docker
/docs
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ You may customize `insights` creating and editing the configuration file:
cp vendor/nunomaduro/phpinsights/stubs/config.php phpinsights.php
```

### With Docker

You can also use `phpinsights` via Docker:
```bash
docker run -it --rm -v /path/to/app:/app nunomaduro/phpinsights
```

### Continuous Integration

You can run PHP Insights in your CI by defining level you want to reach with the options `--min-quality`, `--min-complexity`, `--min-architecture`, `--min-style`.
Expand All @@ -95,6 +102,7 @@ php artisan insights --no-interaction --min-quality=80 --min-complexity=90 --min

All others are optional, so if you want to focus only on style, add the `--min-style` and forget others.


### Display issues omitted

PHP Insights console command have different verbosity levels, which determine the quantity of issues displayed. By default, commands display only the 3 first issues per `Insight`, but you can display them all with the `-v` option:
Expand Down
26 changes: 26 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:7.3-cli-alpine

ENV COMPOSER_ALLOW_SUPERUSER=1

COPY --from=composer:1.8 /usr/bin/composer /usr/bin/composer

COPY . /phpinsights

RUN apk add --no-cache --update git \
\
&& composer install -d /phpinsights \
--no-dev \
--no-ansi \
--no-interaction \
--no-scripts \
--no-suggest \
--no-progress \
--prefer-dist \
\
&& echo 'memory_limit = -1' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini \
\
&& ln -sfv /phpinsights/bin/phpinsights /usr/bin/phpinsights

WORKDIR /app

ENTRYPOINT ["phpinsights"]

0 comments on commit 2e98ebf

Please sign in to comment.