Commit 7a50ab37 authored by Vasek Sraier's avatar Vasek Sraier

all servers now build and run successfully, some configuration are still missing

parent d638d2b7
......@@ -2,8 +2,12 @@
RMBT_SECRET_KEY=rmbt_secret_key
RMBT_DB_USER=rmbt
RMBT_DB_PASSWORD=pgpass
RMBT_DB_HOST=pghost
TOMCAT_USER=admin
TOMCAT_PASSWORD=devpass
TEST_SERVER_URL=netmetr-test-server
# Local testing setup using Docker
* run with `docker-compose up` in this directory
* used constants:
* postgres username: `rmbt`
* postgres password: `pgpass`
* RMBT_SECRET_KEY: `rmbt_secret_key`
All commands and files are referenced from this directory
* first, all Java servers must be compiled
* Java8 required, otherwise it fails
* run `bash build_servers.sh`
* build and run with `docker-compose up`
* configuration is in `.env` file
## Servers
......@@ -12,14 +14,19 @@
* requires these extensions
* quantile
* postgis (version 1.5)
* ... ??? ...
* postgis
* currently running Postgres 9.5 with Postgis 2.5
* needs to run init scripts on first run
* initialize and enable extensions
* initialize all tables the server will be using
* exports port 5432 to localhost, so that it is possible to connect pgAdmin (credentials in `.env` file)
### Control
* runs Tomcat8 with 3 Serverlet apps
* connects to the database
* credentials for Tomcat administration are in file `control/tomcat-users.xml`
* exports port 8080, where administration (credentials in `.env`) and the webapps run
### Speed
......@@ -28,4 +35,6 @@
### QoS
* runs single Java server (directly, no application server required)
\ No newline at end of file
* runs single Java server (directly, no application server required)
* requires a certificate to run
* this server has SSL disabled, so we don't need now
FROM tomcat:8.0
ARG TOMCAT_USER
ARG TOMCAT_PASSWORD
# Redirect Tomcat output to the stdout to make development easier
RUN ln -s /dev/stdout /usr/local/tomcat/logs/catalina.out
RUN ln -s /dev/stdout /usr/local/tomcat/logs/catalina.err
COPY docker/control/tomcat-users.xml /etc/tomcat8/tomcat-users.xml
RUN sed -i 's/%%USER%%/'$TOMCAT_USER'/g; s/%%PASSWORD%%/'$TOMCAT_PASSWORD'/g' /etc/tomcat8/tomcat-users.xml
RUN rm -r /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/docs /usr/local/tomcat/webapps/examples
......
......@@ -41,5 +41,5 @@
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
<user username="admin" password="x9k9292qb6vf2ige" roles="manager-gui,manager-script" />
<user username="%%USER%%" password="%%PASSWORD%%" roles="manager-gui,manager-script" />
</tomcat-users>
......@@ -16,6 +16,9 @@ services:
build:
context: ../
dockerfile: docker/control/Dockerfile
args:
- TOMCAT_USER
- TOMCAT_PASSWORD
ports:
- "8888:8080"
links:
......@@ -33,5 +36,7 @@ services:
build:
context: ../
dockerfile: docker/speed/Dockerfile
args:
- RMBT_SECRET_KEY
depends_on:
- control
FROM ubuntu
RUN apt-get update && apt-get upgrade && apt-get install -y default-jre-headless && apt-get clean
RUN apt-get update && apt-get install -y default-jre-headless && apt-get clean
RUN useradd -m netztest
......@@ -10,6 +10,8 @@ WORKDIR /home/netztest/qos_server
ADD RMBTQoSServer/qos_server.sh .
ADD RMBTQoSServer/config.properties .
RUN sed -i 's/server.ssl=true/server.ssl=false/g' config.properties
RUN cat config.properties | sed -e 's/^server\.ip/#server.ip/g' > config.properties.new; mv config.properties.new config.properties
ADD RMBTQoSServer/build/libs/RMBTQoSServer.jar .
......
FROM ubuntu:latest
RUN apt-get update && apt-get upgrade && apt-get install -y openssl make gcc
ARG RMBT_SECRET_KEY
RUN apt-get update && apt-get install -y openssl make gcc libssl-dev
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
COPY RMBTServer/ /code
RUN echo "#define RMBT_SECRETKEY \"$RMBT_SECRET_KEY\"" > secret.h
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