How to run the truffle3-frontend-example in docker

Git repository: https://github.com/dougvk/truffle3-frontend-example

  1. Download the code from the Git repository
  2. Start docker and run the command

3. List the running containers

4. Copy the CONTAINER ID for docker_truffle3_

5. once the container starts, find the hash of the truffle3_container service and run docker attach <hash> . In this case the hash if the CONTAINER ID for docker_truffle3_

6. yarn install or npm install depending on your preference

7. change truffle.js to point to that network. this is testrpc:8545 from inside the container. To do that you will need cat as editor:

You need to paste the file’s contents with the modification and to save CTRL+D

8. truffle compile to create the json contract artifacts

9. truffle migrate to deploy the contracts onto the network

10. change the web3 provider in app/main.js to point to the testrpc server. !! this will be localhost:7000 !! In this case you do not need to do anything.

11. npm run build to compile the javascript and html assets into the build folder

12. truffle serve to serve the assets in the build folder

13. navigate to localhost:7001/index.html in your browser to see the served assets

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store