Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 1.95 KB

development_install.md

File metadata and controls

74 lines (49 loc) · 1.95 KB

Developer documentation

Local installation guide using Docker

Prerequisites

Installing the application

  1. Get the docker installation repository and the source code:

     git clone [email protected]:eftafmo/dataviz.git
     cd dataviz
    
  2. Prepare environment:

     cp docker/docker-compose.override-dev.yml.example docker-compose.override.yml
     cp docker/web.dev.env.example docker/web.env
    
  3. Create local settings:

     cp dv/localsettings.py.example dv/localsettings.py
    
  4. Start services:

     docker-compose up -d
    
  5. Replace database file with the latest version from production

     scp [email protected]:eeag.sqlite3 /tmp/eeag.sqlite3
     docker cp /tmp/eeag.sqlite3 eeag_web:/var/local/db/eeag.sqlite3
    
  6. Step in the container, install requirements, and rebuild indexes.

     docker-compose exec web bash
     pip install -r requirements/dev.txt -c requirements/constraints.txt
     python manage.py rebuild_index --noinput
    
  7. Install npm and start webpack dev server(leave this container open):

     npm install
     npm run dev
    
  8. Open another web container and start the django server:

     docker-compose exec web bash
     python manage.py runserver 0.0.0.0:8000
    

Local installation without Docker

python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements/dev.txt -c requirements/constraints.txt
nvm use 20
npm install
# Copy settings and adjust as necessary
cp dv/localsettings.py.example dv/localsettings.py

# Copy data file from prod/test
mkdir -p ../db
scp [email protected]:eeag.sqlite3 ../db

# See es_local.md if you also need Elasticsearch and
# build search indexes
python manage.py rebuild_index --noinput

# start Django and frontend server
python manage.py runserver 0:8000
# in a new terminal
npm run dev