Commit d638d2b7 authored by Vasek Sraier's avatar Vasek Sraier

docker_compose: database initialization is now successful, QoS and speed are still failing

parent 3c619972
# This is an environment definition for docker deployment
RMBT_SECRET_KEY=rmbt_secret_key
RMBT_DB_USER=rmbt
RMBT_DB_PASSWORD=pgpass
RMBT_DB_HOST=pghost
TEST_SERVER_URL=netmetr-test-server
......@@ -2,6 +2,9 @@
cd $(git rev-parse --show-toplevel)
# environment definition
source docker/.env
# compile server
build() {
cd $1
......@@ -9,7 +12,7 @@ build() {
gradle clean build $@
cd ..
}
build RMBTControlServer -PRMBT_SECRET_KEY=rmbt_secret_key -PRMBT_DB_USERNAME=pguser -PRMBT_DB_PASSWORD=pgpass -PRMBT_DB_HOST=pghost
build RMBTControlServer -PRMBT_SECRET_KEY="$RMBT_SECRET_KEY" -PRMBT_DB_USERNAME="$RMBT_DB_USER" -PRMBT_DB_PASSWORD="$RBMT_DB_PASSWORD" -PRMBT_DB_HOST="$RMBT_DB_HOST"
build RMBTStatisticServer
build RMBTMapServer
build RMBTQoSServer
......
......@@ -6,8 +6,11 @@ services:
context: ../
dockerfile: docker/postgres/Dockerfile
environment:
POSTGRES_PASSWORD: pgpass
POSTGRES_USER: rmbt
- POSTGRES_PASSWORD=${RMBT_DB_PASSWORD}
- POSTGRES_USER=${RMBT_DB_USER}
- TEST_SERVER_URL
ports:
- "5432:5432"
control:
build:
......@@ -16,7 +19,7 @@ services:
ports:
- "8888:8080"
links:
- "postgres:pghost"
- "postgres:${RMBT_DB_HOST}"
depends_on:
- postgres
......
......@@ -5,11 +5,16 @@ RUN apt-get update && apt-get install -y pgxnclient make gcc postgresql-server-d
#RUN apt-get install -y --no-install-recommends postgresql-9.5-postgis-2.5
RUN mv /docker-entrypoint-initdb.d/postgis.sh /docker-entrypoint-initdb.d/00_postgis.sh
ADD docker/postgres/enable_extensions.sql /docker-entrypoint-initdb.d/02_enable_extensions.sql
ADD docker/postgres/init_roles.sh /docker-entrypoint-initdb.d/05_init_roles.sh
ADD docker/postgres/rmbt.sql /docker-entrypoint-initdb.d/10_rmbt.sql
ADD RMBTControlServer/rmbt_init.sql /docker-entrypoint-initdb.d/11_rmbt_init.sql
ADD RMBTControlServer/qos_texts-en.sql /docker-entrypoint-initdb.d/12_qos_texts-en.sql
ADD RMBTControlServer/qos_texts-cs.sql /docker-entrypoint-initdb.d/13_qos_texts-cs.sql
ADD RMBTControlServer/qos_tests.sql /docker-entrypoint-initdb.d/14_qos_tests.sql
ADD RMBTControlServer/rmbt_settings.sql /docker-entrypoint-initdb.d/15_rmbt_settings.sql
#ADD docker/postgres/init_roles.sh /docker-entrypoint-initdb.d/05_init_roles.sh
ADD docker/postgres/init_tables.sh /docker-entrypoint-initdb.d/06_init_tables.sh
RUN mkdir /init_sql
ADD docker/postgres/rmbt.sql /init_sql/10_rmbt.sql
ADD docker/postgres/rmbt_init.sql /init_sql/11_rmbt_init.sql
RUN sed -i 's/<TEST_SERVER_URL>/'"$TEST_SERVER_URL"'/g' /init_sql/11_rmbt_init.sql
ADD RMBTControlServer/qos_texts-en.sql /init_sql/12_qos_texts-en.sql
ADD RMBTControlServer/qos_texts-cs.sql /init_sql/13_qos_texts-cs.sql
ADD RMBTControlServer/qos_tests.sql /init_sql/14_qos_tests.sql
ADD RMBTControlServer/rmbt_settings.sql /init_sql/15_rmbt_settings.sql
CREATE EXTENSION hstore;
\ No newline at end of file
#!/bin/bash
set -e
echo "Initializing tables in DB $POSTGRES_DB"
psql_rmbt() {
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB"
}
echo "CREATE EXTENSION hstore;" | psql_rmbt
for f in /init_sql/*; do
echo "Processing file $f"
cat "$f" | psql_rmbt
done
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment