2016-07-17 20:59:24 +00:00
|
|
|
FROM ubuntu:trusty
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
2016-04-01 22:43:51 +00:00
|
|
|
ENV PATH $PATH:/usr/local/nginx/sbin
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
EXPOSE 1935
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
# create directories
|
2016-09-23 13:10:04 +00:00
|
|
|
RUN mkdir /src /config /logs /data /static
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
# update and upgrade packages
|
2016-09-23 13:10:04 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get upgrade -y && \
|
|
|
|
apt-get clean && \
|
|
|
|
apt-get install -y --no-install-recommends build-essential \
|
|
|
|
wget software-properties-common && \
|
2015-03-09 20:40:56 +00:00
|
|
|
# ffmpeg
|
2016-09-23 13:10:04 +00:00
|
|
|
add-apt-repository ppa:mc3man/trusty-media && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends ffmpeg && \
|
2015-03-09 20:40:56 +00:00
|
|
|
# nginx dependencies
|
2016-09-23 13:10:04 +00:00
|
|
|
apt-get install -y --no-install-recommends libpcre3-dev \
|
|
|
|
zlib1g-dev libssl-dev wget && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
# get nginx source
|
2016-09-23 13:10:04 +00:00
|
|
|
WORKDIR /src
|
2017-07-12 14:55:19 +00:00
|
|
|
RUN wget http://nginx.org/download/nginx-1.7.5.tar.gz && \
|
2017-07-05 19:21:51 +00:00
|
|
|
tar zxf nginx-1.7.5.tar.gz && \
|
|
|
|
rm nginx-1.7.5.tar.gz && \
|
2015-03-09 20:40:56 +00:00
|
|
|
# get nginx-rtmp module
|
2016-09-23 13:10:04 +00:00
|
|
|
wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.6.tar.gz && \
|
|
|
|
tar zxf v1.1.6.tar.gz && \
|
|
|
|
rm v1.1.6.tar.gz
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
# compile nginx
|
2017-07-05 19:21:51 +00:00
|
|
|
WORKDIR /src/nginx-1.7.5
|
2016-09-23 13:10:04 +00:00
|
|
|
RUN ./configure --add-module=/src/nginx-rtmp-module-1.1.6 \
|
|
|
|
--conf-path=/config/nginx.conf \
|
|
|
|
--error-log-path=/logs/error.log \
|
|
|
|
--http-log-path=/logs/access.log && \
|
|
|
|
make && \
|
|
|
|
make install
|
2015-03-09 20:40:56 +00:00
|
|
|
|
|
|
|
ADD nginx.conf /config/nginx.conf
|
|
|
|
ADD static /static
|
|
|
|
|
2016-09-23 13:10:04 +00:00
|
|
|
WORKDIR /
|
2015-03-09 20:40:56 +00:00
|
|
|
CMD "nginx"
|