Add ganache container
Add ganache container Update 'README.md'
This commit is contained in:
parent
233379966b
commit
02be3f815d
14
README.md
14
README.md
@ -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
|
||||||
```
|
```
|
||||||
|
@ -9,3 +9,10 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./app:/app
|
- ./app:/app
|
||||||
tty: true
|
tty: true
|
||||||
|
|
||||||
|
ganache:
|
||||||
|
build:
|
||||||
|
context: ./ganache
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "8545"
|
||||||
|
9
docker/ganache/Dockerfile
Normal file
9
docker/ganache/Dockerfile
Normal 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
|
Loading…
Reference in New Issue
Block a user