-
Notifications
You must be signed in to change notification settings - Fork 6
Express mode
The Express mode has been thought to provide:
- the ability to showcase Torino without requiring the configuration of a whole system (PostgreSQL db, app registrations, etc.)
- the ability to run a local instance, simply starting a Docker container
Even though the system was not designed to work primarily this way, running the system in Express mode could make sense for personal use, or use on a small scale within a intranet.
This page provides some more details about how to run the system this way.
If, for any reason, it is desired to run an instance of Torino using a SQLite database for the persistence layer of the virtual file system instead of the Table API of the Storage Account, do the following to persist your database across docker updates:
Create a folder for Torino in your $HOME
:
mkdir $HOME/.torino
Download a current copy of the database from the docker image:
docker cp $(docker create --rm robertoprevato/torino:latest):/home/torino.db ~/.torino/torino.db
💡 In alternative, it is possible to create one using
alembic upgrade head
from a clean clone of the repository, having prepared a Python virtual environment
Run a Docker container that mounts the SQLite torino.db
from your host to the /home/torino.db
path of the container.
docker run --rm --name "torinodemo" \
-p 8080:80 \
-e APP_STORAGE_ACCOUNT_NAME=$ACCOUNT_NAME \
-e APP_STORAGE_ACCOUNT_KEY=$ACCOUNT_KEY \
-e APP_DB_CONNECTION_STRING="sqlite+aiosqlite:///torino.db" \
-v $HOME/.torino/torino.db:/home/torino.db \
torino
Using a SQLite database can be a viable solution for personal use, or for intranet solutions, and has the benefit that more features can be enabled in the future for the system: for example support for searching by file name, and different queries that are not supported by the Table API; without adding the complexity of handling a PostgreSQL database.
The instructions are for the Unix bash, but they can be easily adapted by Windows users.
To enable the integration with an Azure Application Insights service, use the following environmental variable when starting the Docker container:
-e APP_MONITORING_KEY="<INSTRUMENTATION_KEY>"
The system collects logs of the API, performance metrics of the Storage dependencies, pictures resizing, and all queries executed by SQLAlchemy.