How to: run a new BookDB release on nyarlathotep

There are two ways in which you might want to run a new BookDB release on nyarlathotep:

  1. For testing, using a throwaway database.

  2. For real, using the real database.

Deploying a test release

  1. Stop the systemd service:

    ! systemctl stop bookdb
    
  2. Build your new bookdb release:

    s b --nix
    
  3. Start a postgres container:

    din -p 127.0.0.1:5432:5432 -e POSTGRES_USER=bookdb -e POSTGRES_DB=bookdb postgres
    
  4. Create the database:

    s e --nix -- env BOOKDB_PG_USERNAME=bookdb bookdb makedb
    
  5. Run the bookdb server:

    s e --nix -- env BOOKDB_WEB_ROOT=http://bookdb.nyarlathotep BOOKDB_PG_USERNAME=bookdb BOOKDB_FILE_ROOT=$(pwd)/static/ bookdb run
    

Deploying a real release

  1. Build a docker image:

    docker build -t localhost:5000/bookdb:latest .
    
  2. Push the image:

    docker push localhost:5000/bookdb:latest
    
  3. Restart the systemd service:

    ! systemctl restart bookdb