Sign inSign up

wjf8882300/nginx-rtmp-module

By wjf8882300

•Updated over 4 years ago

用于推拉流

Image
0

236

wjf8882300/nginx-rtmp-module repository overview

docker run -d -p 80:80 -p 8888:8888 -p 8080:8080 -v /data/nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf --name nginx wjf8882300/nginx-rtmp-module:1.16.3

Dockerfile

FROM centos:centos7

# MAINTAINER
MAINTAINER [email protected]

# running required command
RUN yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel
RUN yum install -y libxslt-devel -y gd gd-devel GeoIP GeoIP-devel pcre pcre-devel
RUN yum install -y unzip
RUN useradd -M -s /sbin/nologin nginx

# download nginx and nginx-rtmp-module
RUN curl -o nginx-1.16.1.tar.gz -sSL http://nginx.org/download/nginx-1.16.1.tar.gz \
    && tar zxvf nginx-1.16.1.tar.gz \
    && curl -o nginx-rtmp-module.zip -sSL https://github.com/arut/nginx-rtmp-module/archive/master.zip \
        && unzip nginx-rtmp-module.zip \
        && mv nginx-rtmp-module-master nginx-1.16.1/nginx-rtmp-module \
        && mv nginx-1.16.1 /usr/local/src/

# change dir to /usr/local/src/nginx-1.16.1
WORKDIR /usr/local/src/nginx-1.16.1

# execute command to compile nginx
# 1.16.6 add http_sub_module to replace response
RUN ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --add-module=nginx-rtmp-module --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_sub_module && make && make install

RUN ln -sf /dev/stdout /usr/local/nginx/logs/access.log \
    && ln -sf /dev/stderr /usr/local/nginx/logs/error.log

RUN rm -rf /usr/local/nginx/conf/nginx.conf
COPY nginx.conf /usr/local/nginx/conf/nginx.conf

# change dir to /usr/local/nginx
WORKDIR /usr/local/nginx

EXPOSE 80

CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

nginx.conf

worker_processes  1;
events {
    use epoll;
    worker_connections  1024;
}

rtmp {
	server {
            listen 8888 so_keepalive=5s:2:2;
            chunk_size 4096;
 
            drop_idle_publisher 10s;

            application live {
               live on;
               notify_method get;
               on_publish http://172.19.115.21/rtmp/on_publish;
               on_publish_done http://172.19.115.21/rtmp/on_publish_done;
           }		

       }
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
           listen 8080;
           location /stat {
               rtmp_stat all;
               rtmp_stat_stylesheet stat.xsl;
           }

           location /stat.xsl {
               root /usr/local/src/nginx-rtmp-module/;
           }	

     }

}

Tag summary

Content type

Image

Digest

Size

234.9 MB

Last updated

over 4 years ago

docker pull wjf8882300/nginx-rtmp-module:1.16.6