Skip to content

Commit

Permalink
Merge 10d5935 into d95b3c6
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagodevweb committed Dec 11, 2021
2 parents d95b3c6 + 10d5935 commit 79d3883
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github
.dockerignore
.gitignore
.releaserc.yml
/vendor
LICENCE
README_CN.md
README.md
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ composer.lock
# coverage report
/build

.phpunit.*
.phpunit.*
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM php:7.1-cli-alpine3.10

WORKDIR /var/www

ARG PHP_EXTENSIONS="bcmath"
RUN apk --update add --no-cache $PHPIZE_DEPS bash && \
docker-php-ext-install ${PHP_EXTENSIONS}

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,44 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
<a href="https://opencollective.com/casbin/sponsor/8/website" target="_blank"><img src="https://opencollective.com/casbin/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/casbin/sponsor/9/website" target="_blank"><img src="https://opencollective.com/casbin/sponsor/9/avatar.svg"></a>

## Development environment

Requirements:

- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)

Usage:

Set a alias
```bash
alias dcrr='docker-compose run --rm'
```
Install PHP dependencies
```bash
dcrr depi
#or
docker-compose run --rm depi
```
Update PHP dependencies
```bash
dcrr depu
#or
docker-compose run --rm depu
```
Run tests
```bash
dcrr test
#or
docker-compose run --rm test
```
Run stan
```bash
dcrr stan
#or
docker-compose run --rm stan
```

## License

This project is licensed under the [Apache 2.0 license](LICENSE).
Expand All @@ -232,3 +270,4 @@ If you have any issues or feature requests, please contact us. PR is welcomed.
- https://github.com/php-casbin/php-casbin/issues
- techlee@qq.com
- Tencent QQ group: [546057381](//shang.qq.com/wpa/qunwpa?idkey=8ac8b91fc97ace3d383d0035f7aa06f7d670fd8e8d4837347354a31c18fac885)

20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'
services:
casbin: &casbin
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/var/www
depi:
<<: *casbin
entrypoint: composer install
depu:
<<: *casbin
entrypoint: composer update
test:
<<: *casbin
entrypoint: php vendor/bin/phpunit
stan:
<<: *casbin
entrypoint: php vendor/bin/phpstan

0 comments on commit 79d3883

Please sign in to comment.