The backend can be run inside a docker container for testing purposes. To build the image, run:
docker-compose up --build
This will build the image and start the container, together with development versions of the frontend.
- backend will be running at http://localhost:3030
- frontend will be running at http://localhost:4201
- old frontend will be running at http://localhost:8080
The master account is admin@localhost
with password change-me
.
The backend is created together with a sample seminar repository. To use the repository, you must clone it locally after starting the container:
git clone .docker/data/seminar.git seminar-dev
The backend will automatically push and pull from the repository in the container, you can work with your own clone.
Running manually is discouraged, as it requires a lot of setup. If you still want to run the backend manually, follow the instructions below.
- Python 3.7+
- virtualenv
- packages from
requirements.txt
- isolate
- Clone this repository.
- Run
init-makedirs.sh
. - Install virtualenv & packages into
ksi-py3-venv
directory.virtualenv -p python3 ksi-py3-venv source ksi-py3-venv/bin/activate pip3 install -r requirements.txt
- Enter db url into
config.py
file. Format is the same as specified inconfig.py.dist
- Uncomment part of the
app.py
, which creates database structure. - Run the server, comment the database-create-section in
run.py
- Install
isolate
with box directory/tmp/box
. - Bind-mount
/etc
directory to/opt/etc
(this is required for sandbox to work):Do not forget to add it to$ mount --bind /etc /opt/etc
/etc/fstab
. - Optional: make
/tmp
tmpfs. - Optional: ensure the server will be started after system boots up
(run
./runner start
).
- To start server run:
./runner start
. - To stop server run:
./runner stop
. - The
runner
script must be executed in server`s root directory. - Logs are stored in
/var/log/gunicorn/*
.