Add ganache container

Add ganache container
Update 'README.md'
This commit is contained in:
sc0Vu 2018-04-25 10:25:09 +08:00
parent 233379966b
commit 02be3f815d
3 changed files with 28 additions and 2 deletions

View File

@ -233,7 +233,7 @@ git clone https://github.com/sc0Vu/web3.php.git
2. Copy web3.php to web3.php/docker/app directory and start container. 2. Copy web3.php to web3.php/docker/app directory and start container.
``` ```
cp files docker/app && docker-compose up -d php cp files docker/app && docker-compose up -d php ganache
``` ```
3. Enter php container and install packages. 3. Enter php container and install packages.
@ -241,7 +241,17 @@ cp files docker/app && docker-compose up -d php
docker-compose exec php ash docker-compose exec php ash
``` ```
4. Run test script 4. Change testHost in `TestCase.php`
```
/**
* testHost
*
* @var string
*/
protected $testHost = 'http://ganache:8545';
```
5. Run test script
``` ```
vendor/bin/phpunit vendor/bin/phpunit
``` ```

View File

@ -9,3 +9,10 @@ services:
volumes: volumes:
- ./app:/app - ./app:/app
tty: true tty: true
ganache:
build:
context: ./ganache
dockerfile: Dockerfile
ports:
- "8545"

View File

@ -0,0 +1,9 @@
FROM node:9.11.1-alpine
MAINTAINER Peter Lai <alk03073135@gmail.com>
RUN npm install -g ganache-cli
EXPOSE 8545
CMD ganache-cli --hostname=0.0.0.0