Docker containers refactoring: each repo has its own files

This commit is contained in:
pabloFuente 2017-07-12 18:58:21 +02:00
parent b5f42f4e9d
commit bb361401df
26 changed files with 3061 additions and 4991 deletions

View File

@ -0,0 +1,48 @@
FROM ubuntu:16.04
MAINTAINER openvidu@gmail.com
# Install Kurento Media Server (KMS)
RUN echo "deb http://ubuntu.kurento.org xenial kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 2F819BC0 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install kurento-media-server-6.0 \
&& rm -rf /var/lib/apt/lists/*
COPY kms.sh /kms.sh
COPY ngrok.sh /ngrok.sh
# Install Java
RUN apt-get update && apt-get install -y openjdk-8-jdk && rm -rf /var/lib/apt/lists/*
# ngrok
RUN apt-get update && apt-get install unzip
RUN set -x \
&& apt-get update \
&& apt-get install wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip -d /home/ngrok \
&& rm -f ngrok-stable-linux-amd64.zip ngrok
COPY ngrok.yml /home/ngrok/ngrok.yml
# Configure Supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists/*
# Install OpenVidu Server
COPY openvidu-server.jar openvidu-server.jar
RUN set -x \
&& echo 'ngrok:x:6737:6737:Ngrok user:/home/ngrok:/bin/false' >> /etc/passwd \
&& echo 'ngrok:x:6737:' >> /etc/group \
&& chown ngrok:ngrok /home/ngrok \
&& chmod -R go=u,go-w /home/ngrok \
&& chmod go= /home/ngrok
EXPOSE 8443
EXPOSE 4040
# Exec supervisord
CMD ["/usr/bin/supervisord"]

View File

@ -0,0 +1,23 @@
# Copy openvidu-server project except angular-cli project ('frontend' folder)
rsync -ax --exclude='**/angular' --exclude='**/static' ../../../openvidu/openvidu-server .
# Comment root path Basic Authorization in SecurityConfig.java
sed -i 's/\.antMatchers(\"\/\").authenticated()/\/\/.antMatchers(\"\/\").authenticated()/g' ./openvidu-server/src/main/java/io/openvidu/server/security/SecurityConfig.java
# Copy plainjs-demo web files into static folder of openvidu-server project
cp -a ../web/. ./openvidu-server/src/main/resources/static/
# Build and package maven project
cd openvidu-server
mvn clean compile package -DskipTests=true
# Copy .jar in docker build path
cp target/openvidu-server-0.0.1-SNAPSHOT.jar ../openvidu-server.jar
# Build docker image
cd ..
docker build -t openvidu/getaroom-demo .
# Delete unwanted files
rm -rf ./openvidu-server
rm openvidu-server.jar

View File

@ -0,0 +1,19 @@
#!/bin/bash -x
set -e
if [ -n "$KMS_TURN_URL" ]; then
echo "turnURL=$KMS_TURN_URL" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
if [ -n "$KMS_STUN_IP" -a -n "$KMS_STUN_PORT" ]; then
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$KMS_STUN_IP" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$KMS_STUN_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
# Remove ipv6 local loop until ipv6 is supported
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
export GST_DEBUG=Kurento*:5
exec /usr/bin/kurento-media-server "$@"

View File

@ -0,0 +1,6 @@
exec $HOME/ngrok start --all -config=$HOME/ngrok.yml > $HOME/ngrok.log &
while true
do
sleep 100000
done
exit 0

View File

@ -0,0 +1,5 @@
web_addr: 0.0.0.0:4040
tunnels:
app:
addr: 8443
proto: http

View File

@ -0,0 +1,18 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log;
pidfile=/var/run/supervisord.pid;
loglevel=debug
[program:kms]
command=/bin/bash /kms.sh
redirect_stderr=true
[program:openvidu-server]
command=/bin/bash -c "java -Dspring.profiles.active=ngrok -Dserver.port=8443 -jar /openvidu-server.jar"
redirect_stderr=true
[program:ngrok]
environment=HOME="/home/ngrok",USER="ngrok"
command=/bin/bash /ngrok.sh
redirect_stderr=true

File diff suppressed because one or more lines are too long

View File

@ -36,8 +36,8 @@ export class AppComponent {
}
joinSession() {
this.OV = new OpenVidu('wss://' + location.hostname + ':8443/');
this.session = this.OV.initSession('apikey', this.sessionId);
this.OV = new OpenVidu();
this.session = this.OV.initSession('wss://' + location.hostname + ':8443/' + this.sessionId);
// 2) Specify the actions when events take place
this.session.on('streamCreated', (event) => {

View File

@ -0,0 +1,48 @@
FROM ubuntu:16.04
MAINTAINER openvidu@gmail.com
# Install Kurento Media Server (KMS)
RUN echo "deb http://ubuntu.kurento.org xenial kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 2F819BC0 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install kurento-media-server-6.0 \
&& rm -rf /var/lib/apt/lists/*
COPY kms.sh /kms.sh
COPY ngrok.sh /ngrok.sh
# Install Java
RUN apt-get update && apt-get install -y openjdk-8-jdk && rm -rf /var/lib/apt/lists/*
# ngrok
RUN apt-get update && apt-get install unzip
RUN set -x \
&& apt-get update \
&& apt-get install wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip -d /home/ngrok \
&& rm -f ngrok-stable-linux-amd64.zip ngrok
COPY ngrok.yml /home/ngrok/ngrok.yml
# Configure Supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists/*
# Install OpenVidu Server
COPY openvidu-server.jar openvidu-server.jar
RUN set -x \
&& echo 'ngrok:x:6737:6737:Ngrok user:/home/ngrok:/bin/false' >> /etc/passwd \
&& echo 'ngrok:x:6737:' >> /etc/group \
&& chown ngrok:ngrok /home/ngrok \
&& chmod -R go=u,go-w /home/ngrok \
&& chmod go= /home/ngrok
EXPOSE 5000
EXPOSE 4040
# Exec supervisord
CMD ["/usr/bin/supervisord"]

View File

@ -0,0 +1,26 @@
# Copy openvidu-server project except angular-cli project ('frontend' folder)
rsync -ax --exclude='**/angular' --exclude='**/static' ../../../openvidu/openvidu-server .
# Comment root path Basic Authorization in SecurityConfig.java
sed -i 's/\.antMatchers(\"\/\").authenticated()/\/\/.antMatchers(\"\/\").authenticated()/g' ./openvidu-server/src/main/java/io/openvidu/server/security/SecurityConfig.java
# Copy plainjs-demo web files into static folder of openvidu-server project
cp -a ../web/. ./openvidu-server/src/main/resources/static/
# Change port and protocol in URL param of new OpenVidu object in app.js
#sed -i 's/\OV.initSession(\"wss:\/\/\" + location.hostname + \":8443\/\"/OV.initSession(\"wss:\/\/\" + location.hostname + \"\/\"/g' ./openvidu-server/src/main/resources/static/app.js
# Build and package maven project
cd openvidu-server
mvn clean compile package -DskipTests=true
# Copy .jar in docker build path
cp target/openvidu-server-0.0.1-SNAPSHOT.jar ../openvidu-server.jar
# Build docker image
cd ..
docker build -t openvidu/openvidu-plainjs-demo .
# Delete unwanted files
rm -rf ./openvidu-server
rm openvidu-server.jar

View File

@ -0,0 +1,19 @@
#!/bin/bash -x
set -e
if [ -n "$KMS_TURN_URL" ]; then
echo "turnURL=$KMS_TURN_URL" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
if [ -n "$KMS_STUN_IP" -a -n "$KMS_STUN_PORT" ]; then
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$KMS_STUN_IP" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$KMS_STUN_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
# Remove ipv6 local loop until ipv6 is supported
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
export GST_DEBUG=Kurento*:5
exec /usr/bin/kurento-media-server "$@"

View File

@ -0,0 +1,6 @@
exec $HOME/ngrok start --all -config=$HOME/ngrok.yml > $HOME/ngrok.log &
while true
do
sleep 100000
done
exit 0

View File

@ -0,0 +1,5 @@
web_addr: 0.0.0.0:4040
tunnels:
app:
addr: 5000
proto: http

View File

@ -0,0 +1,18 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log;
pidfile=/var/run/supervisord.pid;
loglevel=debug
[program:kms]
command=/bin/bash /kms.sh
redirect_stderr=true
[program:openvidu-server]
command=/bin/bash -c "java -Dspring.profiles.active=ngrok -jar /openvidu-server.jar"
redirect_stderr=true
[program:ngrok]
environment=HOME="/home/ngrok",USER="ngrok"
command=/bin/bash /ngrok.sh
redirect_stderr=true

File diff suppressed because one or more lines are too long

View File

@ -52,10 +52,10 @@ function joinSession() {
// --- 1) Get an OpenVidu object and init a session with a sessionId ---
// OpenVidu listening on "localhost:8443"
OV = new OpenVidu("wss://" + location.hostname + ":8443/");
OV = new OpenVidu();
// We will join the video-call "sessionId"
session = OV.initSession(sessionId);
session = OV.initSession("wss://" + location.hostname + ":8443/" + sessionId);
// --- 2) Specify the actions when events take place ---
@ -128,4 +128,4 @@ function leaveSession() {
document.getElementById('session').style.display = 'none';
}
/* OPENVIDU METHODS */
/* OPENVIDU METHODS */

View File

@ -0,0 +1,51 @@
FROM ubuntu:16.04
MAINTAINER openvidu@gmail.com
# Install Kurento Media Server (KMS)
RUN echo "deb http://ubuntu.kurento.org xenial kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 2F819BC0 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install kurento-media-server-6.0 \
&& rm -rf /var/lib/apt/lists/*
COPY kms.sh /kms.sh
COPY ngrok.sh /ngrok.sh
# Install Java
RUN apt-get update && apt-get install -y openjdk-8-jdk && rm -rf /var/lib/apt/lists/*
# ngrok
RUN apt-get update && apt-get install unzip
RUN set -x \
&& apt-get update \
&& apt-get install wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip -d /home/ngrok \
&& rm -f ngrok-stable-linux-amd64.zip ngrok
COPY ngrok.yml /home/ngrok/ngrok.yml
# Configure Supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists/*
COPY openvidu-server.jar openvidu-server.jar
COPY openvidu-sample-secure.jar app.jar
RUN sh -c 'touch /openvidu-server.jar'
RUN sh -c 'touch /app.jar'
RUN set -x \
&& echo 'ngrok:x:6737:6737:Ngrok user:/home/ngrok:/bin/false' >> /etc/passwd \
&& echo 'ngrok:x:6737:' >> /etc/group \
&& chown ngrok:ngrok /home/ngrok \
&& chmod -R go=u,go-w /home/ngrok \
&& chmod go= /home/ngrok
EXPOSE 3000
EXPOSE 5000
EXPOSE 4040
# Exec supervisord
CMD ["/usr/bin/supervisord"]

View File

@ -0,0 +1,33 @@
### openvidu-js-java ###
# Build and package maven project
cd .. && mvn clean compile package
# Copy jar in docker build path
cp target/openvidu-js-java-0.0.1-SNAPSHOT.jar docker/openvidu-sample-secure.jar
### openvidu-server ###
# Copy openvidu-server project in docker build path except angular-cli project ('frontend' folder)
cd docker
rsync -ax --exclude='**/angular' ../../../openvidu/openvidu-server .
# Build and package maven project
cd openvidu-server && mvn clean compile package -DskipTests=true
# Copy openvidu.server.jar in docker build path
cp target/openvidu-server-0.0.1-SNAPSHOT.jar ../openvidu-server.jar
### Build Docker container and remove unwanted files ###
cd ..
docker build -t openvidu/openvidu-sample-secure .
rm ./openvidu-sample-secure.jar
rm ./openvidu-server.jar
rm -rf ./openvidu-server

View File

@ -0,0 +1,19 @@
#!/bin/bash -x
set -e
if [ -n "$KMS_TURN_URL" ]; then
echo "turnURL=$KMS_TURN_URL" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
if [ -n "$KMS_STUN_IP" -a -n "$KMS_STUN_PORT" ]; then
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$KMS_STUN_IP" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$KMS_STUN_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
# Remove ipv6 local loop until ipv6 is supported
cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
export GST_DEBUG=Kurento*:5
exec /usr/bin/kurento-media-server "$@"

View File

@ -0,0 +1,6 @@
exec $HOME/ngrok start --all -config=$HOME/ngrok.yml > $HOME/ngrok.log &
while true
do
sleep 100000
done
exit 0

View File

@ -0,0 +1,8 @@
web_addr: 0.0.0.0:4040
tunnels:
app:
addr: 3000
proto: http
server:
addr: 5000
proto: http

View File

@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log;
pidfile=/var/run/supervisord.pid;
loglevel=debug
[program:kms]
command=/bin/bash /kms.sh
redirect_stderr=true
[program:openvidu-server]
command=/bin/bash -c "java -Dspring.profiles.active=ngrok -Dopenvidu.security=true -jar /openvidu-server.jar"
redirect_stderr=true
[program:openvidu-js-java]
command=/bin/bash -c "java -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=container -jar /app.jar"
redirect_stderr=true
[program:ngrok]
environment=HOME="/home/ngrok",USER="ngrok"
command=/bin/bash /ngrok.sh
redirect_stderr=true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long