diff --git a/README.md b/README.md index 707afc8..40a6091 100644 --- a/README.md +++ b/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. ``` -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. @@ -241,7 +241,17 @@ cp files docker/app && docker-compose up -d php 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 ``` diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 730dbe9..9924d78 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -9,3 +9,10 @@ services: volumes: - ./app:/app tty: true + + ganache: + build: + context: ./ganache + dockerfile: Dockerfile + ports: + - "8545" diff --git a/docker/ganache/Dockerfile b/docker/ganache/Dockerfile new file mode 100644 index 0000000..fe4f1ca --- /dev/null +++ b/docker/ganache/Dockerfile @@ -0,0 +1,9 @@ +FROM node:9.11.1-alpine + +MAINTAINER Peter Lai + +RUN npm install -g ganache-cli + +EXPOSE 8545 + +CMD ganache-cli --hostname=0.0.0.0 \ No newline at end of file