Running Trustroots with Docker
Trustroots Docker containers are excellent for getting into development quickly.
Development with Docker might be little bit slower than running Mongo and NodeJS directly at your computer, but saves you from installing and configuring all the required dependencies.
- Install Docker on your system.
- Make sure you have
gitinstalled on your system (
git --version, preinstalled on MacOS)
1. Clone the repository
git clone https://github.com/Trustroots/trustroots.git cd trustroots
2. Create a config file
This will do:
cp config/env/local.sample.js config/env/local.js
host: '0.0.0.0' in
config/env/default.js for details if you want to change something.
3. Run the install script
This will take a while. Good news is you just have to sit back and let it do its magic.
You can now access these from your browser:
Running & development
Ctrl+Cto turn off containers.
docker-compose upto start them up again.
- You might want to run containers as daemon:
docker-compose up -dand then read the logs only from “trustroots” container:
docker-compose logs trustroots. You can use a helper script:
docker-compose build --no-cache trustrootsto rebuild them to have fresh install.
- When you do changes to any files, they get recompiled and the browser is refreshed. If this step feels too slow for your needs, it’s because of Docker. This step is faster on local install so you might want to consider that.
- Keep an eye on console in case of compiling errors.
- To read and debug emails, open Maildev http://localhost:1080 in your browser. Mails won’t leave your Docker container.
- To read and debug MongoDB, connect to
27017for example by using Robomongo or MongoDB for Visual Studio.
Refer to regular Install documentations for how to seed content, how to run tests etc.
docker-compose run trustroots to each command instructed at the documentation, for example:
npm run test:server
docker-compose run trustroots npm run test:server
The app is installed to
/trustroots folder inside the container but working directory is set so that any commands default to that folder.