Service | Master | Develop |
---|---|---|
CircleCI | ||
Version |
The development presented in this project is aimed towards providing a simple web interface to show the products of the USGS ShakeMap v. 4 software (http://usgs.github.io/shakemap/sm4_index.html). The web interface renders the standard products provided by ShakeMap dynamically (using leafelet https://github.com/Leaflet/Leaflet) and statically (standard shakemaps).
The apperance of the web portal is easily configurable by replacing the logo and banners. The software can be installed both laptops and on server computers.
$ git clone https://github.com/INGV/shakemap4-web
$ cd shakemap4-web
Copy docker environment file:
$ cp ./Docker/env-example ./Docker/.env
Set NGINX_HOST_HTTP_PORT
in ./Docker/.env
file (default port is 8091
).
Set SHAKEMAP_DATA_PATH
in ./Docker/.env
with the absolute data
path; ie: /home/shake/shakemap4/shakemap_profiles/world/data
To run containers as linux-user (intead of root
), set ENV_UID
and ENV_GID
in ./Docker/.env
file with:
ENV_UID
should be equal to the output ofid -u
commandENV_GID
should be equal to the output ofid -g
command
Copy ./config-example.js
to ./config.js
:
$ cp config-example.js config.js
and update params if you need.
First, build docker images:
$ cd Docker
$ docker-compose build --pull --no-cache
$ cd ..
then, starts docker containers:
$ cd Docker
$ docker-compose up -d
$ cd ..
When all containers are started, connect to:
- http://<your_host>:<your_port>/
default is:
If all works, you should see ShakeMap4-Web web page.
ShakeMap4-Web project runs 2 containers:
- nginx: is used to implement web server
- workspace: is used to implements managment script/tools like
wget
,crontab
, etc...
The workspace container, implements a crontab file to run every minute the script crontabScriptToUpdateEvents.sh
; this script checks the SHAKEMAP_DATA_PATH
path (set previously) to find all <eventid>
to process, modified in the last 2 days.
You can also runs the update process by hand with command:
$ cd Docker
$ docker-compose exec -T workspace bash -c '/usr/bin/python3 /var/www/updateEventList.py --eventid=<eventid>'
$ cd ..
- Update
NGINX_HOST_HTTP_PORT
in.env
- run:
$ docker-compose build nginx
- Restart docker:
$ docker-compose up --no-deps -d nginx
$ docker-compose up --build -d workspace
$ docker-compose build --no-cache
$ docker-compose up -d
$ docker-compose build --no-cache workspace
$ docker-compose pull nginx
To change the banners and logo images (e.g. the INGV banner that can be seen on the screenshots below), you can change the paths in the config.js
file (banner above the menu bar and the image below the table on the homepage) and the inc/header.html
file (image below the menu bar).
This work has been partially funded by the Seismology and Earthquake Engineering Research Infrastructure Alliance for Europe (SERA) project (European Union’s Horizon 2020 research and innovation program Grant Agreement Number 730900) and by the Italian Civil Protection (2019–2021) B2 ShakeMap adjournment project.
Please, feel free to contribute.
(c) 2021 Dario Jozinović dario.jozinovic[at]ingv.it
(c) 2021 Valentino Lauciani valentino.lauciani[at]ingv.it
(c) 2021 Sergio Bruni sergio.bruni[at]ingv.it
Istituto Nazionale di Geofisica e Vulcanologia, Italia