Skip to content

Commit

Permalink
Merge pull request #40 from raphaelrpl/b410-beta
Browse files Browse the repository at this point in the history
Support 4.1.0
  • Loading branch information
raphaelrpl committed Dec 12, 2019
2 parents 08a8ce7 + 9806eb0 commit fc5b852
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .env
@@ -1,6 +1,6 @@
TERRAMA2_PROJECT_NAME=terrama2
TERRAMA2_DOCKER_REGISTRY=terrama2
TERRAMA2_TAG=4.0.11
TERRAMA2_TAG=4.1.0
TERRAMA2_CONFIG_DIR=./conf
TERRAMA2_DATA_DIR=data_vol
TERRAMA2_WEBAPP_ADDRESS=127.0.0.1:36000
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,7 +4,7 @@ __pycache__/
*$py.class

# Generated files
conf/terrama2_webapp.json
conf/terrama2_webapp_settings.json
terrama2/Dockerfile
webapp/Dockerfile
webmonitor/Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -94,6 +94,8 @@ docker network connect terrama2_net terrama2_geoserver
docker network connect terrama2_net terrama2_pg
```

Edit the file `conf/terrama2_webapp_db.json` with database credentials.

After that, configure files version properly:

```bash
Expand Down
15 changes: 15 additions & 0 deletions conf/terrama2_webapp_db.json
@@ -0,0 +1,15 @@
{
"production": {
"username": "postgres",
"password": "postgres",
"database": "terrama2",
"host": "terrama2_pg",
"port": 5432,
"dialect": "postgres",
"define": {
"schema": "terrama2"
},
"logging": false,
"migrationStorageTableSchema": "public"
}
}
Expand Up @@ -11,18 +11,6 @@
"debug": true,
"OGR2OGR": "ogr2ogr",
"SHP2PGSQL": "shp2pgsql",
"db": {
"username": "postgres",
"password": "mysecretpassword",
"database": "terrama2",
"host": "terrama2_pg",
"port": 5432,
"dialect": "postgres",
"define": {
"schema": "terrama2"
},
"logging": false
},
"toolsMenu": [
{
"textEn": "Example",
Expand Down
2 changes: 1 addition & 1 deletion configure-version.sh
Expand Up @@ -9,7 +9,7 @@ eval $(egrep -v '^#' .env | xargs)
for image in terrama2/Dockerfile.in \
webapp/Dockerfile.in \
webmonitor/Dockerfile.in \
conf/terrama2_webapp.json.in; do
conf/terrama2_webapp_settings.json.in; do
sed -r \
-e 's!%%TERRAMA2_TAG%%!'"${TERRAMA2_TAG}"'!g' \
-e 's!%%TERRAMA2_DOCKER_REGISTRY%%!'"${TERRAMA2_DOCKER_REGISTRY}"'!g' \
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Expand Up @@ -11,7 +11,8 @@ services:
volumes:
- "${TERRAMA2_DATA_DIR}:/data"
- "terrama2_shared_vol:/shared-data"
- "${TERRAMA2_CONFIG_DIR}/terrama2_webapp.json:/opt/terrama2/${TERRAMA2_TAG}/webapp/config/instances/default.json"
- "${TERRAMA2_CONFIG_DIR}/terrama2_webapp_db.json:/opt/terrama2/${TERRAMA2_TAG}/webapp/config/db.json"
- "${TERRAMA2_CONFIG_DIR}/terrama2_webapp_settings.json:/opt/terrama2/${TERRAMA2_TAG}/webapp/config/settings.json"
- "${TERRAMA2_CONFIG_DIR}/.pgpass:/root/.pgpass"
networks:
- net
Expand Down
9 changes: 6 additions & 3 deletions terrama2/Dockerfile.in
Expand Up @@ -44,15 +44,16 @@ RUN apt-get update && \
cat /root/.ssh/id_rsa.pub > /home/$TERRAMA2_USER/.ssh/authorized_keys && \
cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys && \
chown -R ${TERRAMA2_USER}:${TERRAMA2_USER} /home/$TERRAMA2_USER/.ssh && \
chmod -R 700 /home/$TERRAMA2_USER/.ssh
chmod -R 700 /home/$TERRAMA2_USER/.ssh && \
echo "${TERRAMA2_USER} ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers


############################################################################
# Dependencies

RUN cd ${TERRAMA2_3RDPARTY_PATH} && \
curl -o terralib-5.3.3-ubuntu-16.04.tar.gz -L http://www.dpi.inpe.br/terralib5/download/download.php?FileName=terralib-5.3.3-ubuntu-16.04.tar.gz && \
tar zxf terralib-5.3.3-ubuntu-16.04.tar.gz && \
curl -o terralib-5.4.5-ubuntu-16.04.tar.gz -L http://www.dpi.inpe.br/jenkins-data/terralib/installers/linux/terralib-5.4.5-ubuntu-16.04_2019-12-11_12-15-5.4.5.tar.gz && \
tar zxf terralib-5.4.5-ubuntu-16.04.tar.gz && \
./install.sh && \
rm -rf * && \
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && \
Expand Down Expand Up @@ -94,4 +95,6 @@ export LC_ALL=en_US.UTF-8" | tee -a /etc/bash.bashrc && \

VOLUME /data

USER ${TERRAMA2_USER}

WORKDIR ${TERRAMA2_INSTALL_PATH}
4 changes: 4 additions & 0 deletions terrama2/files/install_terrama2.sh
Expand Up @@ -36,6 +36,10 @@ if [ $? -ne 0 ]; then
echo "Warning: Could not install TerraMA² Documentation Module"
fi

echo -ne "Configuring permission on /opt to terrama2..."
chown -R terrama2:terrama2 /opt/terrama2/${TERRAMA2_TAG}
valid $? "Could not set permission on directory /opt"

rm -rf /var/lib/apt/lists/*

# No error
Expand Down
2 changes: 1 addition & 1 deletion terrama2/files/start_terrama2_service.sh
Expand Up @@ -3,7 +3,7 @@
set -x

# Start Services
service ssh start
sudo service ssh start

# Arguments
TERRAMA2_SERVICE_TYPE=$1
Expand Down
2 changes: 2 additions & 0 deletions webapp/Dockerfile.in
@@ -1,5 +1,7 @@
FROM %%TERRAMA2_DOCKER_REGISTRY%%/terrama2:%%TERRAMA2_TAG%%

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends \
postgis \
Expand Down

0 comments on commit fc5b852

Please sign in to comment.