forked from JasonRivers/Docker-nginx-rtmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
71 lines (63 loc) · 1.8 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM alpine:latest
MAINTAINER Oleg Gumbar <[email protected]>
ENV NGINX_VERSION 1.11.3
RUN apk update && \
apk add \
git \
gcc \
binutils-libs \
binutils \
gmp \
isl \
libgomp \
libatomic \
libgcc \
openssl \
pkgconf \
pkgconfig \
mpfr3 \
mpc1 \
libstdc++ \
ca-certificates \
libssh2 \
curl \
expat \
pcre \
musl-dev \
libc-dev \
pcre-dev \
zlib-dev \
openssl-dev \
make
RUN cd /tmp/ && \
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
git clone https://github.com/arut/nginx-rtmp-module.git && \
cd nginx-rtmp-module && \
git checkout v1.1.9 && \
cd ..
RUN cd /tmp && \
tar xzf nginx-${NGINX_VERSION}.tar.gz && \
cd nginx-${NGINX_VERSION} && \
./configure \
--prefix=/opt/nginx \
--with-http_ssl_module \
--add-module=../nginx-rtmp-module && \
make && \
make install
RUN echo "rtmp {" >> /opt/nginx/conf/nginx.conf && \
echo " server {" >> /opt/nginx/conf/nginx.conf && \
echo " listen 1935;" >> /opt/nginx/conf/nginx.conf && \
echo " chunk_size 4096;" >> /opt/nginx/conf/nginx.conf && \
echo " application live {" >> /opt/nginx/conf/nginx.conf && \
echo " live on;" >> /opt/nginx/conf/nginx.conf && \
echo " record off;" >> /opt/nginx/conf/nginx.conf && \
echo " }" >> /opt/nginx/conf/nginx.conf && \
echo " application testing {" >> /opt/nginx/conf/nginx.conf && \
echo " live on;" >> /opt/nginx/conf/nginx.conf && \
echo " record off;" >> /opt/nginx/conf/nginx.conf && \
echo " }" >> /opt/nginx/conf/nginx.conf && \
echo " }" >> /opt/nginx/conf/nginx.conf && \
echo "}" >> /opt/nginx/conf/nginx.conf
EXPOSE 1935
EXPOSE 8080
CMD ["/opt/nginx/sbin/nginx", "-g", "daemon off;"]