Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerized #69

Merged
merged 5 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]