Commit 2ffd3dd7 authored by Vasek Sraier's avatar Vasek Sraier

control server and speed server are collaborating correctly, changed container networking

parent 151167ff
......@@ -10,4 +10,5 @@ RMBT_DB_HOST=pghost
TOMCAT_USER=admin
TOMCAT_PASSWORD=devpass
TEST_SERVER_URL=localhost:8888
QOS_SERVER_NAME=qos.netmetr
SPEED_SERVER_NAME=speed.netmetr
......@@ -12,6 +12,7 @@ All commands and files are referenced from this directory
### PostgreSQL
* hostname - `postgres.netmetr`
* requires these extensions
* quantile
* postgis
......@@ -23,21 +24,29 @@ All commands and files are referenced from this directory
### Control
* hostname - `control.netmetr`
* runs Tomcat8 with 3 Serverlet apps
* is remotely debuggable through exported port 5005
* connects to the database
* credentials for Tomcat administration are in file `control/tomcat-users.xml`
* port exports
* 5005 - Java remote debugging port (in IntelliJ IDEA add remote run configuration)
* 8080 - HTTP - administration (credentials in `.env`)
* ports
* 5005 - remote java debugger
* 80 - http
### Speed
* hostname - `speed.netmetr`
* runs single C program
* requires a certificate - when building, new self-signed is created
### QoS
* hostname - `qos.netmetr`
* 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
## DNS
* to access services running in the containers, use [dns-proxy-server](https://github.com/mageddo/dns-proxy-server/releases)
* you can then use hostnames to access the servers
......@@ -12,6 +12,9 @@ COPY docker/control/tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
RUN sed -i 's/%%USER%%/'$TOMCAT_USER'/g; s/%%PASSWORD%%/'$TOMCAT_PASSWORD'/g' /usr/local/tomcat/conf/tomcat-users.xml
COPY docker/control/manager-context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml
# Change Tomcat HTTP port to 80
RUN sed -i 's_port="8080" protocol="HTTP/1.1"_port="80" protocol="HTTP/1.1"_g' /usr/local/tomcat/conf/server.xml
# Install web apps
RUN rm -r /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/docs /usr/local/tomcat/webapps/examples
COPY RMBTStatisticServer/build/libs/RMBTStatisticServer.war /usr/local/tomcat/webapps/
......
......@@ -2,19 +2,24 @@ version: '3'
services:
postgres:
hostname: postgres.netmetr
build:
context: ../
dockerfile: docker/postgres/Dockerfile
args:
- TEST_SERVER_URL
- SPEED_SERVER_NAME
- QOS_SERVER_NAME
- RMBT_SECRET_KEY
environment:
- POSTGRES_PASSWORD=${RMBT_DB_PASSWORD}
- POSTGRES_USER=${RMBT_DB_USER}
- TEST_SERVER_URL
- QOS_SERVER_NAME
- SPEED_SERVER_NAME
ports:
- "5432:5432"
control:
hostname: control.netmetr
build:
context: ../
dockerfile: docker/control/Dockerfile
......@@ -22,7 +27,6 @@ services:
- TOMCAT_USER
- TOMCAT_PASSWORD
ports:
- "8888:8080"
- "5005:5005"
links:
- "postgres:${RMBT_DB_HOST}"
......@@ -34,12 +38,14 @@ services:
command: ["/usr/local/tomcat/bin/catalina.sh", "jpda", "run"]
qos:
hostname: qos.netmetr
build:
context: ../
dockerfile: docker/qos/Dockerfile
depends_on:
- control
speed:
hostname: speed.netmetr
build:
context: ../
dockerfile: docker/speed/Dockerfile
......
FROM mdillon/postgis:9.5
ARG TEST_SERVER_URL
RUN apt-get update && apt-get install -y pgxnclient make gcc postgresql-server-dev-9.5 && pgxn install quantile
#RUN apt-get install -y --no-install-recommends postgresql-9.5-postgis-2.5
......@@ -14,7 +12,14 @@ RUN mkdir /init_sql
ADD docker/postgres/rmbt_schema.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
ARG QOS_SERVER_NAME
ARG SPEED_SERVER_NAME
ARG RMBT_SECRET_KEY
RUN sed -i 's/SPEED_SERVER_NAME/'$SPEED_SERVER_NAME'/g' /init_sql/11_rmbt_init.sql
RUN sed -i 's/QOS_SERVER_NAME/'$QOS_SERVER_NAME'/g' /init_sql/11_rmbt_init.sql
RUN sed -i 's/RMBT_SECRET_KEY/'$RMBT_SECRET_KEY'/g' /init_sql/11_rmbt_init.sql
ADD docker/postgres/qos_texts-en.sql /init_sql/12_qos_texts-en.sql
ADD docker/postgres/qos_texts-cs.sql /init_sql/13_qos_texts-cs.sql
......
......@@ -10381,12 +10381,13 @@ SELECT pg_catalog.setval('provider_uid_seq', 33, true);
-- Data for Name: test_server; Type: TABLE DATA; Schema: public; Owner: rmbt
--
COPY test_server (uid, name, web_address, port, port_ssl, city, country, geo_lat, geo_long, location, web_address_ipv4, web_address_ipv6, server_type) FROM stdin;
1 CZ.NIC <TEST_SERVER_URL> 5231 443 Prague any 50.0729504 14.4376124 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 <TEST_SERVER_URL> <TEST_SERVER_URL> RMBT
3 CZ.NIC <TEST_SERVER_URL> 5233 5233 Prague CZ 50.0729504 14.4376124 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 <TEST_SERVER_URL> <TEST_SERVER_URL> RMBT
COPY public.test_server (uid, name, web_address, port, port_ssl, city, country, geo_lat, geo_long, location, web_address_ipv4, web_address_ipv6, priority, weight, active, uuid, key, selectable, server_type, secret) FROM stdin;
1 CZ.NIC SPEED_SERVER_NAME 8081 443 Prague any 50.0729504000000034 14.4376124000000008 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 SPEED_SERVER_NAME SPEED_SERVER_NAME 0 1 t 463b5cb0-ab62-4bd1-b8b3-0dbd575755cc \N t RMBT RMBT_SECRET_KEY
5 CZ.NIC SPEED_SERVER_NAME 8082 8444 Prague any 50.0729504000000034 14.4376124000000008 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 SPEED_SERVER_NAME SPEED_SERVER_NAME 0 1 t dee45848-57cc-4ebc-b390-cad18d85b2e9 \N t RMBTws RMBT_SECRET_KEY
4 CZ.NIC SPEED_SERVER_NAME 100 444 Prague any 50.0729504000000034 14.4376124000000008 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 SPEED_SERVER_NAME SPEED_SERVER_NAME 0 1 t a5936972-c676-4926-93d0-98187bead833 \N t fup RMBT_SECRET_KEY
3 CZ.NIC QOS_SERVER_NAME 5443 5443 Prague any 50.0729504000000034 14.4376124000000008 010100002031BF0D00DD5C867A26E03B41B6FC3597AA775741 QOS_SERVER_NAME QOS_SERVER_NAME 0 1 t 3370ce31-41b2-4b6c-a67e-c9c6ad8870a7 \N t QoS RMBT_SECRET_KEY
\.
---
--- Data for Name: test_type
---
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