grhistory / grhs_site

1 stars 0 forks source link

Local Development Setup

Run postgresql:

cd app/src
# edit grhs_site/settings/__init__.py to import from ".dev" for now
make develop_env
# after server is running, ctrl-c

source venv/bin/activate
make superuser

make runserver

Login:

Docs: https://wagtail-cookiecutter-foundation.readthedocs.io/en/latest/

Redo initial_data.sql:

dropdb grhs_site && make db initial_data migrate extra_data superuser

Docker Environment

We're using Docker to run the application on the production server (and it can be used for development as well). Docker installations instructions can be found here, with Ubuntu-specific instructions (for the production VM) here. Docker compose install instructions can be found https://docs.docker.com/compose/install/#install-compose.

A .env is used to define configuration variables for the application and for the Docker build. It should reside in the ./app/config directory. A .env-template file is provided to list the currently-used variable names.

To help speeed up the rebuild process on app changes, the app image has been split up into multiple images. Details can be seen within the ./devops/ directory. TODO: Add some scripts for creating supporting image.

Depending in the server setup, the scripts will have to be run under sudo in order to access the Docker daemon.

Starting the App

Once the .env file is set up, and all the supporting images have been created, docker-compose can handle all the rest. Some scripts are available as wrappers around the complexity of app executions.

N.B. The -p flag is being used to have a more friendly name for the containers. There currently isn't an easy way to keep that in sync in all the bash scripts, so be aware of that when changing the name (sorry!).