forked from brocaar/nginx-rtmp-dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (32 loc) · 1.3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND noninteractive
ENV PATH $PATH:/usr/local/nginx/sbin
EXPOSE 1935
EXPOSE 8080
EXPOSE 80
# create directories
RUN mkdir /src && mkdir /config && mkdir /logs && mkdir /data && mkdir /static
RUN mkdir /data/rec
# update and upgrade packages
RUN apt-get update && apt-get upgrade -y && apt-get clean
RUN apt-get install -y build-essential wget
# ffmpeg
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:mc3man/trusty-media
RUN apt-get update
RUN apt-get install -y ffmpeg
# nginx dependencies
RUN apt-get install -y libpcre3-dev zlib1g-dev libssl-dev
RUN apt-get install -y wget
# get nginx source
RUN cd /src && wget http://nginx.org/download/nginx-1.10.1.tar.gz && tar zxf nginx-1.10.1.tar.gz && rm nginx-1.10.1.tar.gz
# get nginx-rtmp module
RUN cd /src && wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.8.tar.gz && tar zxf v1.1.8.tar.gz && rm v1.1.8.tar.gz
# compile nginx
RUN cd /src/nginx-1.10.1 && ./configure --add-module=/src/nginx-rtmp-module-1.1.8 --conf-path=/config/nginx.conf --error-log-path=/logs/error.log --http-log-path=/logs/access.log
RUN cd /src/nginx-1.10.1 && make && make install
# Correct permission for record folder
RUN chown www-data:root /data/rec
ADD nginx.conf /config/nginx.conf
ADD static /static
CMD "nginx"