Create new dev environment

This page explains how to set up a new, local development environment to test the GRASA Event Locator system.

Requirements

Setup

A configuration file must be provided at start, either as a config.yml in the root directory of the project or a path specified as a CONFIGPATH environment variable. For local development, run the following command to get started with development:

cp config.yml.example config.yml

Run project with docker-compose

docker-compose is used for local development. It is convenient since it gives you a MySQL container to work alongside the application; you do not have to set one up. Use the following commands to build the containers and then start them:

docker-compose build
docker-compose up

These commands may require sudo depending on your operating system and installation option.

Run docker-compose in detached mode

Detached mode disables an output stream to your terminal. In other words, detached mode will not display logs in the terminal window while running. Use the following command to run in detached mode:

docker-compose up --detach

To shut down docker-compose in detached mode, use this command:

docker-compose down

Open in web browser

Once docker-compose is running, open a web browser. Visit localhost:8000 to view the site running locally.