Commit e8d72032 authored by Vasek Sraier's avatar Vasek Sraier

started working on proper docker-compose.yml to orchestrate the servers

* added linking between postgres and control => control no longer fails to start
* postgres server is still missing some extensions => initialization fails
* speed and qos servers fail to start, not sure why
parent c624487d
......@@ -50,6 +50,9 @@ processResources << {
if (project.hasProperty('RMBT_DB_PASSWORD')) {
contextXmlContent = contextXmlContent.replaceAll(/DB_PASSWORD/, RMBT_DB_PASSWORD)
}
if (project.hasProperty('RMBT_DB_HOST')) {
contextXmlContent = contextXmlContent.replaceAll(/localhost/, RMBT_DB_HOST)
}
generatedContextXmlFile.write(contextXmlContent, 'UTF-8')
File configurationFile = file("${project.buildDir}/resources/main/at/alladin/rmbt/res/Configuration.properties");
......
# Local testing setup using Docker
* run with `docker-compose up` in this directory
* used constants:
* postgres username: `pguser`
* postgres password: `pgpass`
* RMBT_SECRET_KEY: `rmbt_secret_key`
## Servers
### PostgreSQL
* requires these extensions
* quantile
* postgis (version 1.5)
* ... ??? ...
### Control
* runs Tomcat8 with 3 Serverlet apps
* connects to the database
* credentials for Tomcat administration are in file `control/tomcat-users.xml`
### Speed
* runs single C program
* requires a certificate - when building, new self-signed is created
### QoS
* runs single Java server (directly, no application server required)
\ No newline at end of file
......@@ -5,24 +5,14 @@ cd $(git rev-parse --show-toplevel)
# compile server
build() {
cd $1
gradle clean build
shift
gradle clean build $@
cd ..
}
build RMBTControlServer
build RMBTControlServer -PRMBT_SECRET_KEY=rmbt_secret_key -PRMBT_DB_USERNAME=pguser -PRMBT_DB_PASSWORD=pgpass -PRMBT_DB_HOST=pghost
build RMBTStatisticServer
build RMBTMapServer
build RMBTQoSServer
# netmetr-control server
docker build -t netmetr-control -f docker/control/Dockerfile .
# netmetr-qos
docker build -t netmetr-qos -f docker/qos/Dockerfile RMBTQoSServer/
# netmetr-speed
docker build -t netmetr-speed -f docker/speed/Dockerfile RMBTServer/
version: '2'
version: '3'
services:
netmetr-control:
build: control/
postgres:
build:
context: ../
dockerfile: docker/postgres/Dockerfile
environment:
POSTGRES_PASSWORD: pgpass
POSTGRES_USERNAME: pguser
control:
build:
context: ../
dockerfile: docker/control/Dockerfile
ports:
- "8888:8080"
postgres:
image: postgres
netmetr-qos:
build: qos/
netmetr-speed:
build: ../RMBTServer
links:
- "postgres:pghost"
depends_on:
- postgres
qos:
build:
context: ../
dockerfile: docker/qos/Dockerfile
depends_on:
- control
speed:
build:
context: ../
dockerfile: docker/speed/Dockerfile
depends_on:
- control
FROM postgres:10
RUN apt-get update && apt-get install -y pgxnclient make gcc postgresql-server-dev-10 && pgxn install quantile
RUN apt-get install -y postgresql-10-postgis-2.5
ADD RMBTControlServer/rmbt.sql /docker-entrypoint-initdb.d/00_rmbt.sql
ADD RMBTControlServer/rmbt_init.sql /docker-entrypoint-initdb.d/01_rmbt_init.sql
ADD RMBTControlServer/qos_texts-en.sql /docker-entrypoint-initdb.d/02_qos_texts-en.sql
ADD RMBTControlServer/qos_texts-cs.sql /docker-entrypoint-initdb.d/03_qos_texts-cs.sql
ADD RMBTControlServer/qos_tests.sql /docker-entrypoint-initdb.d/04_qos_tests.sql
ADD RMBTControlServer/rmbt_settings.sql /docker-entrypoint-initdb.d/05_rmbt_settings.sql
......@@ -8,15 +8,15 @@ RUN useradd -m netztest
RUN mkdir -p /home/netztest/qos_server
WORKDIR /home/netztest/qos_server
ADD qos_server.sh .
ADD config.properties .
ADD RMBTQoSServer/qos_server.sh .
ADD RMBTQoSServer/config.properties .
RUN cat config.properties | sed -e 's/^server\.ip/#server.ip/g' > config.properties.new; mv config.properties.new config.properties
ADD build/libs/RMBTQoSServer.jar .
ADD RMBTQoSServer/build/libs/RMBTQoSServer.jar .
RUN mkdir -p /var/run/netztest/ && touch /var/run/netztest/qos_server.pid
RUN mkdir -p /var/log/qos
RUN mkdir -p /var/www/rmbt/qostest/
ADD assets/ /var/www/rmbt/qostest/
ADD RMBTQoSServer/assets/ /var/www/rmbt/qostest/
CMD ["/usr/bin/java","-jar","RMBTQoSServer.jar"]
......@@ -2,10 +2,11 @@ FROM ubuntu:latest
RUN apt-get update && apt-get upgrade && apt-get install -y openssl make gcc
COPY . /code
RUN mkdir /code
WORKDIR /code
RUN openssl req -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -subj '/CN=localhost'
COPY . /code
CMD ["/usr/bin/make","run"]
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