Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

SebastiaanPasterkamp/dnd-machine

Repository files navigation

D&D Machine

This project has been replaced by https://github.com/SebastiaanPasterkamp/dndmachine

Build Status

Setup python environment

virtualenv <path/to/python-env>/dndmachine
. <path/to/python-env>/dndmachine/bin/activate
pip install -r requirements.txt

Initial setup

export FLASK_APP=app/app.py
./run.py --debug --initdb

Building

( cd ui && npm install )
( cd ui && npm run build )

Testing

python tests/run_tests.py
( cd ui && npm run test )

Running in a Development setup

NPM

( cd ui && npm run dev )

Server

export FLASK_APP=app/app.py
./run.py --debug

Upgrading

export FLASK_APP=app/app.py
./run.py --debug --updatedb
./run.py --debug --migrate

Running D&D machine

export FLASK_APP=app/app.py
./run.py --threaded

Visit D&D Machine

Docker

The docker image keeps the flask database in a volume, so it's persistent between restarts. The database will be upgraded during start-up should the container start with a newer version.

Running from Docker

Building the image

docker build \
    --tag dnd-machine:latest .

Running the image

# Replace existing images
docker stop dndmachine
docker rm dndmachine
# Launch the new image
docker run \
    --detach \
    --publish 5000:5000 \
    --name dndmachine \
    --restart always \
    dnd-machine:latest

Developing in Docker

Building the images

docker-compose build

Running the images

docker-compose up

Taking down the images

docker-compose down