diff --git a/Dockerfile b/Dockerfile index e4a2978..d68b9ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:18.04 RUN apt-get update RUN apt-get upgrade -y -RUN apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev unzip ffmpeg wget zlib1g zlib1g-dev libssl-dev sudo +RUN apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev unzip ffmpeg wget zlib1g zlib1g-dev libssl-dev sudo curl RUN useradd --create-home -s /bin/bash www ;\ adduser www sudo @@ -29,6 +29,11 @@ ADD crossdomain.xml /usr/local/nginx/html/crossdomain.xml ADD nginx.conf /home/www RUN sudo chown -R www:www /usr/local/nginx +# aws cli +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +RUN unzip -u awscliv2.zip +RUN sudo ./aws/install + EXPOSE 80 443 1935 CMD ["/usr/local/nginx/sbin/nginx", "-c", "/home/www/nginx.conf"] diff --git a/nginx.conf b/nginx.conf index aed3ba5..f2dde81 100644 --- a/nginx.conf +++ b/nginx.conf @@ -133,6 +133,12 @@ rtmp { record all; record_path /home/www/video_recordings; record_suffix -%d-%b-%y-%T.flv; + + # on_record_done http://example.com/recorded; + + # convert recorded file to mp4 format + # exec_record_done ffmpeg -y -i $path -acodec libmp3lame -ar 44100 -ac 1 -vcodec libx264 $dirname/$basename.mp4; + exec_record_done ./sync_to_s3.sh $path } application vj { diff --git a/sync_to_s3.sh b/sync_to_s3.sh new file mode 100755 index 0000000..2c7237f --- /dev/null +++ b/sync_to_s3.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PATH=ARGV[1] +aws s3 cp $PATH s3://datafruitsvizdumps +rm $PATH