Commit c624487d authored by Vasek Sraier's avatar Vasek Sraier

created Dockerfiles for all 3 servers, automated build of them, still WIP

parent c7e13397
#!/bin/bash
cd $(git rev-parse --show-toplevel)
# compile server
build() {
cd $1
gradle clean build
cd ..
}
build RMBTControlServer
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/
FROM tomcat:8.0
# 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 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/
COPY RMBTMapServer/build/libs/RMBTMapServer.war /usr/local/tomcat/webapps/
COPY RMBTControlServer/build/libs/RMBTControlServer.war /usr/local/tomcat/webapps/
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<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" />
</tomcat-users>
version: '2'
services:
netmetr-control:
build: control/
ports:
- "8888:8080"
postgres:
image: postgres
netmetr-qos:
build: qos/
netmetr-speed:
build: ../RMBTServer
FROM ubuntu
RUN apt-get update && apt-get upgrade && apt-get install -y default-jre-headless && apt-get clean
RUN useradd -m netztest
RUN mkdir -p /home/netztest/qos_server
WORKDIR /home/netztest/qos_server
ADD qos_server.sh .
ADD 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 .
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/
CMD ["/usr/bin/java","-jar","RMBTQoSServer.jar"]
FROM ubuntu:latest
RUN apt-get update && apt-get upgrade && apt-get install -y openssl make gcc
COPY . /code
WORKDIR /code
RUN openssl req -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -subj '/CN=localhost'
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