docker-nginx-rtmp/Dockerfile

82 lines
2.5 KiB
Docker
Raw Permalink Normal View History

2020-07-07 12:21:39 +00:00
FROM phusion/baseimage:bionic-1.0.0
2018-07-25 06:15:46 +00:00
LABEL author Andreas Neue <an@dnix.de>
2016-10-24 01:49:28 +00:00
2020-07-07 12:21:39 +00:00
ENV NGINX_VERSION 1.19.0
ENV NGINX_VTS_VERSION 0.1.18
ENV NGINX_RTMP_VERSION 1.2.1
ENV FFMPEG_VERSION 3.4.2
2016-10-24 01:49:28 +00:00
EXPOSE 1935
EXPOSE 80
2020-07-07 12:21:39 +00:00
RUN mkdir -p /opt/data && mkdir /www
2016-10-24 01:49:28 +00:00
# Build dependencies.
2016-10-24 01:49:28 +00:00
2018-07-25 06:08:54 +00:00
# update and upgrade packages
RUN apt-get update && apt-get upgrade -y && apt-get clean
RUN apt-get install -y build-essential wget htop vim nasm
RUN apt-get install -y software-properties-common
#RUN apt-get install -y ffmpeg
RUN apt-get install -y libpcre3-dev zlib1g-dev libssl-dev libass-dev \
libfdk-aac-dev libmp3lame-dev libopus-dev librtmp-dev libtheora-dev \
libvorbis-dev libvpx-dev libx264-dev libx265-dev libwebp-dev
2016-10-24 01:49:28 +00:00
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
2016-10-24 01:49:28 +00:00
RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
2016-10-24 02:17:32 +00:00
./configure \
--enable-version3 \
--enable-gpl \
--enable-nonfree \
--enable-small \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-libvpx \
--enable-libtheora \
--enable-libvorbis \
--enable-libopus \
--enable-libfdk-aac \
--enable-libass \
--enable-libwebp \
--enable-librtmp \
--enable-postproc \
--enable-avresample \
--enable-libfreetype \
--enable-openssl \
--disable-debug && \
make && make install && make distclean
2016-10-24 01:49:28 +00:00
2018-07-25 06:08:54 +00:00
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
2020-07-07 12:21:39 +00:00
RUN cd /tmp && \
curl -fSL https://github.com/vozlt/nginx-module-vts/archive/v${NGINX_VTS_VERSION}.tar.gz -o nginx-module-vts-${NGINX_VTS_VERSION}.tar.gz && \
tar -zxf nginx-module-vts-${NGINX_VTS_VERSION}.tar.gz && \
rm nginx-module-vts-${NGINX_VTS_VERSION}.tar.gz
2018-07-25 06:08:54 +00:00
RUN cd /tmp/nginx-${NGINX_VERSION} && \
./configure \
--prefix=/opt/nginx \
--add-module=/tmp/nginx-rtmp-module-${NGINX_RTMP_VERSION} \
2020-07-07 12:21:39 +00:00
--add-module=/tmp/nginx-module-vts-${NGINX_VTS_VERSION} \
2018-07-25 06:08:54 +00:00
--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
2016-10-24 01:49:28 +00:00
2020-07-07 12:21:39 +00:00
ADD nginx.conf /opt/nginx/nginx.conf
ADD static /www/static
2016-10-24 01:49:28 +00:00
2020-07-07 12:21:39 +00:00
CMD ["/opt/nginx/sbin/nginx"]