Starter Kit for Truffle, Ganache, React enable via Docker.
Inspired by Master Blockchain Step-By-Step from Dapp University.
There are two dockerfiles, one for the truffle development tools and React, and another for ganache-cli. We will use the docker compose file to start and stop the two containers.
We simply start a new instace of Ganache cli in the Dockerfile. We set the port to 8545. Dockerfile
We create an image based on Ubuntu, installing node and npm. Then installing truffle suite. Dockerfile
-
We will use the
docker-compose up
from the root directory to get it up and running using the docker-compose.yml. This will create the stack with two Docker containers, One is Ganache and the other one will be Truffle + React. -
All the src code will be copied over to the Truffle container see the Dockerfile.
-
You can now connect to the the Truffle container using this command
docker exec -it truffle-suite bash
. -
Make sure your in the
workspace
directory inside your Truffle container. From there you can runtruffle version
to make sure everything is installed.