From b8c0101478dd46450e2cc033468aba598b1524a8 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 25 Jul 2018 08:08:54 +0200 Subject: [PATCH] use ubuntu:18.04 baseimage --- Dockerfile | 78 ++++++++++++++++++++---------------------------------- nginx.conf | 2 +- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/Dockerfile b/Dockerfile index 464d974..2f462be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM alpine:3.4 -LABEL author Alfred Gutierrez +FROM ubuntu:18.04 +LABEL author Andreas Neue > /etc/apk/repositories -RUN apk add --update fdk-aac-dev - -# Get FFmpeg source. RUN cd /tmp/ && \ wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ tar zxf ffmpeg-${FFMPEG_VERSION}.tar.gz && rm ffmpeg-${FFMPEG_VERSION}.tar.gz -# Compile ffmpeg. RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \ ./configure \ --enable-version3 \ @@ -86,10 +49,25 @@ RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \ --disable-debug && \ make && make install && make distclean -# Cleanup. -RUN rm -rf /var/cache/* /tmp/* +RUN cd /tmp && \ + wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ + tar zxf nginx-${NGINX_VERSION}.tar.gz && \ + rm nginx-${NGINX_VERSION}.tar.gz + +RUN cd /tmp && \ + wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz && \ + tar zxf v${NGINX_RTMP_VERSION}.tar.gz && rm v${NGINX_RTMP_VERSION}.tar.gz + +RUN cd /tmp/nginx-${NGINX_VERSION} && \ + ./configure \ + --prefix=/opt/nginx \ + --add-module=/tmp/nginx-rtmp-module-${NGINX_RTMP_VERSION} \ + --conf-path=/opt/nginx/nginx.conf \ + --error-log-path=/opt/nginx/logs/error.log \ + --http-log-path=/opt/nginx/logs/access.log \ + --with-debug && \ + cd /tmp/nginx-${NGINX_VERSION} && make && make install -# Add NGINX config and static files. ADD nginx.conf /opt/nginx/nginx.conf ADD static /www/static diff --git a/nginx.conf b/nginx.conf index c9ebd0c..7d4e484 100644 --- a/nginx.conf +++ b/nginx.conf @@ -14,7 +14,7 @@ rtmp { application stream { live on; - exec ffmpeg -i rtmp://localhost:1935/stream/$name + exec /usr/local/bin/ffmpeg -i rtmp://localhost:1935/stream/$name -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 2500k -f flv -g 30 -r 30 -s 1280x720 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_720p2628kbs -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 1000k -f flv -g 30 -r 30 -s 854x480 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_480p1128kbs -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 750k -f flv -g 30 -r 30 -s 640x360 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_360p878kbs