-
Notifications
You must be signed in to change notification settings - Fork 410
Getting started via Docker
- 1. Install Docker
- 2. Create the virtual machine
- 3. Clone Repos
- 4. Starting Doubtfire
- 5. Stopping Doubtfire
- 6. For future reference...
Download and install Docker, Docker Machine and Docker Compose for your platform:
For macOS with Homebrew and Homebrew Cask installed, run:
$ brew cask install virtualbox
$ brew install docker docker-machine docker-compose
For macOS without Homebrew installed, you can download the Docker toolbox instead.
Install following the instructions for Docker, Docker Machine, and Docker Compose
Download and install Docker toolkit and run through the getting started guide
docker-machine create --driver virtualbox doubtfire
Add the docker daemon to your .bashrc:
$ echo eval "$(docker-machine env doubtfire)" >> ~/.bashrc
or, if you're using Oh-My-Zsh, add to your .zshrc:
$ echo eval "$(docker-machine env doubtfire)" >> ~/.zshrc
Clone the doubtfire API and web repos to the same directory:
$ git clone https://github.com/doubtfire-lms/doubtfire-web.git
$ git clone https://github.com/doubtfire-lms/doubtfire-api.git
Set up overcommit and install hooks:
$ sudo gem install overcommit
$ cd /path/to/doubtfire-api
$ overcommit --install
$ overcommit --sign
$ cd /path/to/doubtfire-web
$ overcommit --install
$ overcommit --sign
If gem fails, you should ensure Ruby is installed on your system:
- macOS: ruby comes installed with macOS
-
Linux: try installing using
apt-get install ruby-full - Windows: try RubyInstaller
Execute the docker start script under doubtfire-api:
$ cd /path/to/doubtfire-api
$ ./docker.sh start
The populate script will ask you if you would like extended population.
Note that the API and Web servers will take a moment to get up and running.
To stop Doubtfire running, run the stop script under doubtfire-api:
$ cd /path/to/doubtfire-api
$ ./docker.sh stop
You should attach to the grunt watch server if working on the web app to view output, if in case you make a lint error. To do so, run:
$ cd /path/to/doubtfire-api
$ ./docker.sh attach web
You should attach to the rails app if working on the API to view debug output. To do so, run:
$ cd /path/to/doubtfire-api
$ ./docker.sh attach api
Should you need to execute any commands from inside the Docker container, such as running rake tasks, or a rails migration, use docker-compose but execute from within doubtfire-api:
$ cd /path/to/doubtfire-api
$ docker-compose -p doubtfire run api <api command>
$ docker-compose -p doubtfire run web <web command>