Skip to content

Running TerraMA2

Raphael Willian edited this page Apr 16, 2018 · 1 revision

Summary

Check third-parties

GeoServer

If you don't have a running version of GeoServer or you want to try an experimental version, you can use the built-in TerraMA² GeoServer image.

Create a new volume to store the GeoServer data files:

docker volume create terrama2_geoserver_vol

Pull the GeoServer image and run a new container named terrama2_geoserver:

docker run -d \
           --restart unless-stopped --name terrama2_geoserver \
           -p 127.0.0.1:8081:8080 \
           -e "GEOSERVER_URL=/geoserver" \
           -e "GEOSERVER_DATA_DIR=/opt/geoserver/data_dir" \
           -v terrama2_data_vol:/data \
           -v terrama2_shared_vol:/shared-data \
           -v terrama2_geoserver_vol:/opt/geoserver/data_dir \
           -v ${PWD}/conf/terrama2_geoserver_setenv.sh:/usr/local/tomcat/bin/setenv.sh \
           terrama2/geoserver:2.11

The above command will link the host address 127.0.0.1 on port 8081 to the container port 8080 and it will run the container as a daemon in background. You can try the following address in your browser: http://localhost:8081/geoserver.

PostgreSQL + PostGIS

If you don't have a running version of PostgreSQL with the PostGIS extension or you want to try an experimental version, you can use the image prepared by mdillon/postgis.

Create a new volume to store the PostgreSQL data files:

docker volume create terrama2_pg_vol

Pull the PostgreSQL image and run a new container named terrama2_pg:

docker run -d \
           --restart unless-stopped --name terrama2_pg \
           -p 127.0.0.1:5433:5432 \
           -v terrama2_pg_vol:/var/lib/postgresql/data \
           -e POSTGRES_PASSWORD=mysecretpassword \
           mdillon/postgis

The above command will link the host address 127.0.0.1 on port 5433 to the container port 5432 and it will run the container as a daemon in background. You can try the following address in psql or pgAdmin:

psql -U postgres -p 5433 -h localhost -d postgres

In the above command use the password: mysecretpassword.

TerraMA²

Configuring

The TerraMA² Docker contains configuration files located in folder config. You must edit terrama2_webapp.json.in and terrama2_webapp.json in order to execute the environment properly.

Running TerraMA²

In order to link all the pieces of TerraMA², you can create a network named terrama2_net:

docker network create terrama2_net

If you have installed the GeoServer and PostgreSQL as docker containers, as explained in above sections, link them together:

docker network connect terrama2_net terrama2_geoserver
docker network connect terrama2_net terrama2_pg

After that, configure files version properly:

./configure-version.sh

This command will generate conf/terrama2_webapp.json file. You may edit this file for connection parameters.

Now run the docker-compose in daemon mode:

docker-compose -p terrama2 up -d

If you want to check TerraMA² log output:

docker-compose -p terrama2 logs --follow

If you want to stop the TerraMA² containers:

docker-compose -p terrama2 stop

If you want to remove all the stopped containers:

docker-compose -p terrama2 rm

BDQueimadas Light

Create a new volume to store the BDQueimadas Light temporary download files:

docker volume create terrama2_bdq_vol

Pull the BDQueimadas Light image and run a new container named terrama2_bdqlight:

docker run -d \
           --restart unless-stopped --name terrama2_bdq \
           -p 127.0.0.1:39000:39000 \
           -v ${PWD}/conf/bdqueimadas-light/conf/:/opt/bdqueimadas-light/configurations/ \
           -v ${PWD}/conf/bdqueimadas-light/.pgpass:/root/.pgpass \
           -v terrama2_bdq_vol:/opt/bdqueimadas-light/tmp \
           terrama2/bdqlight:1.0.0

Link the BDqueimadas container in terrama2_net:

docker network connect terrama2_net terrama2_bdq
Clone this wiki locally