baseimage-tutorial-framework/README.md

35 lines
1.1 KiB
Markdown
Raw Normal View History

2017-11-27 19:58:34 +00:00
Tutorial Framework
==================
2018-01-10 15:56:03 +00:00
## Frontend
2017-11-27 19:58:34 +00:00
2018-01-10 15:56:03 +00:00
Place an `index.html` and related static files in `src/frontend/dist`, the web server will serve them properly.
2017-11-27 19:58:34 +00:00
## 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.
2018-01-10 15:56:03 +00:00
Run with `docker run -p 8888:8888 <id>` to bind the container's port to localhost.
2017-11-27 19:58:34 +00:00
## Running locally
2018-01-10 15:56:03 +00:00
_This will probably barf at the moment._
2017-12-08 11:00:51 +00:00
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.
2017-11-27 19:58:34 +00:00
2017-12-08 11:00:51 +00:00
To start the project issue
2017-11-27 19:58:34 +00:00
```
cd src/app/
2017-12-08 11:00:51 +00:00
python app.py
2017-11-27 19:58:34 +00:00
```
2017-12-08 11:00:51 +00:00
in one terminal, and
2017-11-27 19:58:34 +00:00
```
cd src/components/
2017-12-08 11:00:51 +00:00
python event_handler_main.py
2017-11-27 19:58:34 +00:00
```
2017-12-08 11:00:51 +00:00
in another. Prepend the python commands with `PYTHONPATH="../../lib/"` if the folder weren't added to the PYTHONPATH
permanently.