openvidu-recording docker container: headless chrome mode

pull/255/head
pabloFuente 2019-04-01 15:57:48 +02:00
parent d02fd1a989
commit ca588de620
2 changed files with 17 additions and 0 deletions

View File

@ -7,6 +7,9 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list && \ echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list && \
apt-get update && apt-get install -y google-chrome-stable apt-get update && apt-get install -y google-chrome-stable
# Download selenium-server
RUN wget --no-verbose https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar -O /selenium-server-standalone.jar
# Install media packages # Install media packages
RUN apt-get install -y software-properties-common RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:jonathonf/ffmpeg-4 RUN add-apt-repository ppa:jonathonf/ffmpeg-4
@ -16,6 +19,9 @@ RUN apt-get install -y ffmpeg pulseaudio xvfb
# Install jq for managing JSON # Install jq for managing JSON
RUN apt-get install -y jq RUN apt-get install -y jq
# Install Java 8
RUN apt-get install -y openjdk-8-jdk-headless
# Clean # Clean
RUN apt-get autoclean RUN apt-get autoclean

View File

@ -1,5 +1,14 @@
#!/bin/bash #!/bin/bash
### Use container as a single headless chrome ###
if [ "$HEADLESS_CHROME_ONLY" == true ]; then
java -jar -Dwebdriver.chrome.driver="$CHROME_DRIVER_PATH" /selenium-server-standalone.jar &> /selenium-server.log &
sleep 100000000
else
### Use container as OpenVidu recording module ###
### Variables ### ### Variables ###
URL=${URL:-https://www.youtube.com/watch?v=JMuzlEQz3uo} URL=${URL:-https://www.youtube.com/watch?v=JMuzlEQz3uo}
@ -107,3 +116,5 @@ ffmpeg -ss $MIDDLE_TIME -i /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT -vfra
### Change permissions to all generated files ### ### Change permissions to all generated files ###
sudo chmod -R 777 /recordings/$VIDEO_ID sudo chmod -R 777 /recordings/$VIDEO_ID
fi