diff --git a/README.md b/README.md index 2474530..2b5c6fd 100644 --- a/README.md +++ b/README.md @@ -247,13 +247,13 @@ To run examples, you need to run ethereum blockchain local (testrpc). If you are using docker as development machain, you can try [ethdock](https://github.com/sc0vu/ethdock) to run local ethereum blockchain, just simply run `docker-compose up -d testrpc` and expose the `8545` port. -# Develop +# Development -### Local php cli installed +### Testing -1. Clone the repo and install packages. +1. Start the container(from web3.php/docker). ``` -git clone https://github.com/web3p/web3.php.git && cd web3.php && composer install +docker-compose up -d php ganache ``` 2. Run test script. @@ -261,38 +261,6 @@ git clone https://github.com/web3p/web3.php.git && cd web3.php && composer insta vendor/bin/phpunit ``` -### Docker container - -1. Clone the repo and run docker container. -``` -git clone https://github.com/web3p/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 ganache -``` - -3. Enter php container and install packages. -``` -docker-compose exec php ash -``` - -4. Change testHost in `TestCase.php` -``` -/** - * testHost - * - * @var string - */ -protected $testHost = 'http://ganache:8545'; -``` - -5. Run test script -``` -vendor/bin/phpunit -``` - ###### Install packages Enter container first ``` diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9924d78..1786876 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: @@ -7,7 +7,7 @@ services: context: ./php dockerfile: Dockerfile-72 volumes: - - ./app:/app + - ../:/app tty: true ganache: @@ -15,4 +15,4 @@ services: context: ./ganache dockerfile: Dockerfile ports: - - "8545" + - "8545:8545" diff --git a/docker/ganache/Dockerfile b/docker/ganache/Dockerfile index 5f99bb9..9ce4c73 100644 --- a/docker/ganache/Dockerfile +++ b/docker/ganache/Dockerfile @@ -6,4 +6,4 @@ RUN npm install -g ganache-cli EXPOSE 8545 -CMD ganache-cli -g 0 -l 6000000 --hostname=0.0.0.0 \ No newline at end of file +CMD ganache-cli -g 0 -l 6000000 --hostname=0.0.0.0