Docker allows us to setup a consistent dev environment that is easy to start, upgrade and reset when required. It also does not pollute your local machines with rubishness if you dont work actively work on the backend.
Install docker through docker toolbox here
Then clone this gist, at the same directory level as Rainforest & Regenwald (https://github.com/rainforestapp/regenwald) So the directory looks like
> folder
> Rainforest
> regenwald
> docker-scripts
Run the following command to pre-build docker containers for Redis, Postgres & Rails
docker-compose build
Setup your docker db container
docker-compose run --rm --service-ports web /rainforest/script/reset_db.sh
Add the following lines to your hosts file. On Mac/Linux the file is located at /etc/hosts
and on windows you can find it at C:\Windows\System32\Drivers\etc\hosts
127.0.0.1 app.rainforest.dev
127.0.0.1 admin.rainforest.dev
127.0.0.1 portal.rainforest.dev
127.0.0.1 vendor.rainforest.dev
Note: You may have to edit the file as root/Administrator
To start rainforest in docker, run
docker-compose up
This will start docker containers, and attach the logs to your terminal. Close the app (Ctrl + c) to stop the containers gracefully.
To reset your local rainforest docker setup, run
docker-compose rm -f -v
docker volume rm rainforest_data-volume
rm -f tmp/pids/server.pid
docker-compose run --rm --service-ports web /rainforest/script/reset_db.sh