FAQ - TerraMA2/docker GitHub Wiki
Frequently Asked Questions
Summary
- General
- How can I add a volume to an existing Docker container?
- How can I configure TerraMA² to run behind a HTTP Server?
General
How can I add a volume to an existing Docker container?
TerraMA² already contains shared volumes mounted through applications. In that case, just move your files into terrama2_shared_vol
or terrama2_data_vol
using the following commands:
# To copy files into `terrama2_data_vol`
docker cp MYFOLDER terrama2_webapp_1:/data
# To copy files into `terrama2_shared_vol`
docker cp MYFOLDER terrama2_webapp_1:/data
Remember that once copy, the data will be available in all containers where volumes are mounted.
If you really need to create a new volume, use the following commands:
nano docker-compose.yml
Add new value inside volumes:
directive for each container:
volumes:
... # other volumes
- "/path/to/myvolume:/myvolume"
Restart TerraMA² application:
docker-compose -p terrama2 stop
docker-compose -p terrama2 up -d
If you use TerraMA² GeoServer, you also need to recreate terrama2_geoserver
container with new volume. Use the following directive:
# Stop and remove GeoServer container
docker stop terrama2_geoserver
docker rm terrama2_geoserver
# Create new GeoServer container with new volume
docker run -d \
-v "/path/to/myvolume:/myvolume" \
--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}/terrama2_geoserver_setenv.sh:/usr/local/tomcat/bin/setenv.sh \
terrama2/geoserver:2.11
How can I configure TerraMA² to run behind a HTTP Server?
Both TerraMA² WebApp and TerraMA² Webmonitor have config files located inside config
folder. Change basePath
in terrama2_webapp.json
and terrama2_webmonitor.json
and then restart application.