magic-nis-backend
A MuSIASEM processors-network engine, product of MAGIC-Nexus project
115
docker run --rm -p 8085:80 magicnexush2020/magic-nis-backend:latestThis single line runs "nis-backend", internally performing three steps: pull the image (magicnexush2020/magic-nis-backend:latest), create and start a -temporary- container, directing log to console, and opening the application on port 8085.
After startup (which happens right after the image has been pulled), please wait about a minute to allow database initialization (log messages stop).
To stop the temporary container, press Ctrl+C.
First, download the image:
docker pull magicnexush2020/magic-nis-backend:latest
Then create a container, passing -or not- the name of a configuration file as an environment variable. If specified, a configuration file must be copied inside the container :
docker create --name nis-local -p 8085:80 magicnexush2020/magic-nis-backend:latest (default configuration)
docker create --name nis-local -p 8085:80 -e MAGIC_NIS_SERVICE_CONFIG_FILE="nis-backend.conf" magicnexush2020/magic-nis-backend:latest
Prepare a configuration file (see description of variables in the table of next section), let us assume it is named "nis-backend.conf", to copy it inside the newly created container:
docker cp nis-backend.conf nis-local:/app/nexinfosys/restful_service/nis-backend.conf
To start the container and log to console, issue the following:
docker start nis-local && docker logs nis-local -f
A volume connected to "/srv" can also be used. For instance:
docker create --name nis-local -p 8085:80 -v /home/dummy/nis-data:/srv -e MAGIC_NIS_SERVICE_CONFIG_FILE="nis-backend.conf" magicnexush2020/magic-nis-backend:latest
If the configuration file states that all directories will hang from "/srv", and the volume parameter is used, data will be stored in a directory outside the container.
If no configuration file is provided (environment variable MAGIC_NIS_SERVICE_CONFIG_FILE not specified), a default configuration file is internally generated.
To specify a custom configuration, a text file with the typical syntax of a Variable and its Value per line must be created:
VAR1="VALUE"
VAR2="VALUE"
| Variable name | Value | Example |
|---|---|---|
| DB_CONNECTION_STRING | Metadata database, SQLAlchemy compliant connection string | "sqlite:///nis_metadata.db" |
| DATA_CONNECTION_STRING | Dataset cache database, SQLAlchemy compliant connection string | "sqlite:///nis_cached_data.db" |
| CASE_STUDIES_DIR | Directory where case studies would be stored | "/srv/nis_data/cs/" |
| FAO_DATASETS_DIR | Directory where FAO datasets are downloaded and cached | "/srv/faostat/" |
| FADN_FILES_LOCATION | Directory where FADN datasets are downloaded and cached | "/srv/fadn" |
| CACHE_FILE_LOCATION | Directory where SDMX datasets are downloaded and cached | "/srv/sdmx_datasets_cache" |
| REDIS_HOST_FILESYSTEM_DIR | If REDIS_HOST='filesystem:local_session', directory where sessions are stored | "/srv/sessions" |
| SSP_FILES_DIR | Not used | "" |
| REDIS_HOST | "localhost" expects a REDIS server available at localhost:6379; "redis-local" creates a local REDIS instance; "filesystem:local_session" uses filesystem to store sessions (perfect option for local execution) | "" |
| TESTING | "True" | "True" |
| FS_TYPE | Not used | "" |
| FS_SERVER | Not used | "" |
| FS_USER | Not used | "" |
| FS_PASSWORD | Not used | "" |
| GAPI_CREDENTIALS_FILE | Path to a file obtained from Google API management web, to directly access a NIS workbook file in Google Sheets | "/srv/credentials.json" |
| GAPI_TOKEN_FILE | Path to a file used to stored authorization token | "/srv/tocken.pickle" |
The source code can be found at:
Content type
Image
Digest
Size
398.5 MB
Last updated
over 5 years ago
Requires Docker Desktop 4.37.1 or later.