Fix usage of variables for fixed values
Some values which are fixed by the docker compose file should not be set as variables, and hardcoded everywhere as required. This also untangles the use of the variables DB_HOST and DB_PORT to be only about the exposed hostname and port, whenever the DB engine is exposed on the server interface.
This commit is contained in:
@@ -143,8 +143,8 @@ services:
|
||||
db-ui:
|
||||
image: ${DB_UI_IMAGE}${DB_UI_VERSION}
|
||||
environment:
|
||||
POSTGRES_HOST: ${DB_HOST}
|
||||
POSTGRES_PORT: ${DB_PORT}
|
||||
POSTGRES_HOST: db
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_USER: ${DB_USER_ADMIN}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD_ADMIN}
|
||||
POSTGRES_DB: ${DB_NAME2}
|
||||
@@ -201,18 +201,18 @@ services:
|
||||
backend:
|
||||
image: ${PORTAL_BACKEND_IMAGE}${PORTAL_BACKEND_VERSION}
|
||||
environment:
|
||||
PORTAL_DB_URL: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME4}
|
||||
PORTAL_DB_SERVER: ${DB_HOST}:${DB_PORT}
|
||||
PORTAL_DB_URL: jdbc:postgresql://db:5432/${DB_NAME4}
|
||||
PORTAL_DB_SERVER: db:5432
|
||||
PORTAL_DB_USER: ${DB_USER4}
|
||||
PORTAL_DB_PASSWORD: ${DB_PASSWORD4}
|
||||
PORTAL_DB_SCHEMA: public # Stable Config
|
||||
META_DB_URL: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME1}
|
||||
META_DB_SERVER: ${DB_HOST}:${DB_PORT}
|
||||
META_DB_URL: jdbc:postgresql://db:5432/${DB_NAME1}
|
||||
META_DB_SERVER: db:5432
|
||||
META_DB_USER: ${DB_USER1}
|
||||
META_DB_PASSWORD: ${DB_PASSWORD1}
|
||||
META_DB_SCHEMA: public # Stable Config
|
||||
FEATURES_DB_URL: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME2}
|
||||
FEATURES_DB_SERVER: ${DB_HOST}:${DB_PORT}
|
||||
FEATURES_DB_URL: jdbc:postgresql://db:5432/${DB_NAME2}
|
||||
FEATURES_DB_SERVER: db:5432
|
||||
FEATURES_DB_USER: ${DB_USER2}
|
||||
FEATURES_DB_PASSWORD: ${DB_PASSWORD2}
|
||||
FEATURES_DB_SCHEMA: public # Stable Config
|
||||
|
||||
10
load_data.sh
10
load_data.sh
@@ -46,7 +46,7 @@ db_id=$(docker run --rm -d \
|
||||
-v ${DB_DATA}:/data:rw \
|
||||
-v ${DB_DATASETS}:/datasets:ro \
|
||||
--network=${MIP_PRIVATE_NETWORK} \
|
||||
--name ${DB_HOST} \
|
||||
--name db \
|
||||
${DB_IMAGE}${DB_VERSION}
|
||||
)
|
||||
|
||||
@@ -64,8 +64,8 @@ done
|
||||
sleep 5
|
||||
|
||||
docker run --rm \
|
||||
-e DB_HOST="${DB_HOST}" \
|
||||
-e DB_PORT="${DB_PORT}" \
|
||||
-e DB_HOST="db" \
|
||||
-e DB_PORT="5432" \
|
||||
-e DB_ADMIN_USER="${DB_USER_ADMIN}" \
|
||||
-e DB_ADMIN_PASSWORD="${DB_PASSWORD_ADMIN}" \
|
||||
${db_list} \
|
||||
@@ -83,8 +83,8 @@ do
|
||||
echo "Executing ${img}${version}"
|
||||
|
||||
docker run --rm \
|
||||
-e FLYWAY_HOST="${DB_HOST}" \
|
||||
-e FLYWAY_PORT="${DB_PORT}" \
|
||||
-e FLYWAY_HOST="db" \
|
||||
-e FLYWAY_PORT="5432" \
|
||||
-e FLYWAY_USER="${DB_USER_ADMIN}" \
|
||||
-e FLYWAY_PASSWORD="${DB_PASSWORD_ADMIN}" \
|
||||
-e FLYWAY_DATABASE_NAME="${db}" \
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# Service Parameters
|
||||
: ${DB_IMAGE:="hbpmip/postgresraw"}
|
||||
: ${DB_VERSION:=":v1.2"}
|
||||
: ${DB_HOST:="db"}
|
||||
: ${DB_PORT:="5432"}
|
||||
: ${DB_HOST:="db"} # External hostname, if exposed
|
||||
: ${DB_PORT:="31432"} # External port, if exposed
|
||||
: ${DB_DATA:="${PWD}/postgres"}
|
||||
: ${DB_DATASETS:="${PWD}/datasets"}
|
||||
: ${DB_USER_ADMIN:="postgres"}
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
: ${DB_UI_IMAGE:="hbpmip/postgresraw-ui"}
|
||||
: ${DB_UI_VERSION:=":v1.4"}
|
||||
: ${DB_UI_PORT:="5555"}
|
||||
: ${DB_UI_PORT:="31555"} # External port, if exposed
|
||||
|
||||
# Databases Definitions:
|
||||
# 1. To add a new DB, copy the last 3 lines below and increment the id
|
||||
|
||||
@@ -104,12 +104,12 @@ db {
|
||||
woken {
|
||||
jdbc_driver = "org.postgresql.Driver"
|
||||
jdbc_jar_path = "/usr/lib/R/libraries/postgresql-9.4-1201.jdbc41.jar"
|
||||
jdbc_url = "jdbc:postgresql://DB_HOST:DB_PORT/DB_NAME3"
|
||||
jdbc_url = "jdbc:postgresql://db:5432/DB_NAME3"
|
||||
jdbc_user = "DB_USER3"
|
||||
jdbc_password = "DB_PASSWORD3"
|
||||
|
||||
host = "DB_HOST"
|
||||
port = DB_PORT
|
||||
host = "db"
|
||||
port = 5432
|
||||
user = "DB_USER3"
|
||||
password = "DB_PASSWORD3"
|
||||
}
|
||||
@@ -117,12 +117,12 @@ db {
|
||||
features {
|
||||
jdbc_driver = "org.postgresql.Driver"
|
||||
jdbc_jar_path = "/usr/lib/R/libraries/postgresql-9.4-1201.jdbc41.jar"
|
||||
jdbc_url = "jdbc:postgresql://DB_HOST:DB_PORT/DB_NAME2"
|
||||
jdbc_url = "jdbc:postgresql://db:5432/DB_NAME2"
|
||||
jdbc_user = "DB_USER2"
|
||||
jdbc_password = "DB_PASSWORD2"
|
||||
|
||||
host = "DB_HOST"
|
||||
port = DB_PORT
|
||||
host = "db"
|
||||
port = 5432
|
||||
user = "DB_USER2"
|
||||
password = "DB_PASSWORD2"
|
||||
}
|
||||
@@ -130,12 +130,12 @@ db {
|
||||
metadata {
|
||||
jdbc_driver = "org.postgresql.Driver"
|
||||
jdbc_jar_path = "postgresql-9.4-1201.jdbc41.jar"
|
||||
jdbc_url = "jdbc:postgresql://DB_HOST:DB_PORT/DB_NAME1"
|
||||
jdbc_url = "jdbc:postgresql://db:5432/DB_NAME1"
|
||||
jdbc_user = "DB_USER1"
|
||||
jdbc_password = "DB_PASSWORD1"
|
||||
|
||||
host = "DB_HOST"
|
||||
port = DB_PORT
|
||||
host = "db"
|
||||
port = 5432
|
||||
user = "DB_USER1"
|
||||
password = "DB_PASSWORD1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user