mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 15:31:21 +00:00
35 lines
1.1 KiB
Markdown
35 lines
1.1 KiB
Markdown
Tutorial Framework
|
|
==================
|
|
|
|
## Frontend
|
|
|
|
Place an `index.html` and related static files in `src/frontend/dist`, the web server will serve them properly.
|
|
|
|
## Building and running with Docker
|
|
|
|
Simply issue `docker build .` in the root of the project. The first build could take a while as it's compiling a fresh
|
|
Python package from source. Subsequent builds can reuse this layer, so their execution time is significantly shorter.
|
|
|
|
Run with `docker run -p 8888:8888 <id>` to bind the container's port to localhost.
|
|
|
|
## Running locally
|
|
|
|
_This will probably barf at the moment._
|
|
|
|
Create a new virtualenv, preferably with [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io). Install the
|
|
dependencies with `pip install tornado pyzmq transitions`. If using virtualenvwrapper, issue `add2virtualenv lib` from
|
|
the project root to add the local libraries to the virtualenv's PYTHONPATH.
|
|
|
|
To start the project issue
|
|
```
|
|
cd src/app/
|
|
python app.py
|
|
```
|
|
in one terminal, and
|
|
```
|
|
cd src/components/
|
|
python event_handler_main.py
|
|
```
|
|
in another. Prepend the python commands with `PYTHONPATH="../../lib/"` if the folder weren't added to the PYTHONPATH
|
|
permanently.
|