Skip to content

Commit

Permalink
nginx-rtmp-module 1.2.1 for alpine (mainline and stable)
Browse files Browse the repository at this point in the history
  • Loading branch information
WoZ committed Feb 26, 2018
1 parent c7c3a0c commit 25d61d8
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx:alpine
FROM nginx:1.13.9-alpine

ENV NGINX_RTMP_MODULE_VERSION 1.2.1

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions 1.2.1/nginx-stable/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM nginx:1.12.2-alpine

ENV NGINX_RTMP_MODULE_VERSION 1.2.1

RUN apk add --no-cache --virtual .build-deps \
curl \
gcc \
libc-dev \
make \
openssl-dev \
pcre-dev \
&& curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
&& curl -fSL https://github.com/arut/nginx-rtmp-module/archive/v$NGINX_RTMP_MODULE_VERSION.tar.gz \
-o nginx-rtmp-module.tar.gz \
&& mkdir -p /usr/src \
&& tar -zxC /usr/src -f nginx.tar.gz \
&& tar -zxC /usr/src -f nginx-rtmp-module.tar.gz \
&& rm nginx.tar.gz \
&& rm nginx-rtmp-module.tar.gz \
&& cd /usr/src/nginx-$NGINX_VERSION \
&& ./configure \
--with-compat \
--with-debug \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--add-dynamic-module=/usr/src/nginx-rtmp-module-$NGINX_RTMP_MODULE_VERSION \
&& make -j$(getconf _NPROCESSORS_ONLN) modules \
&& install -m755 objs/ngx_rtmp_module.so /usr/lib/nginx/modules/ngx_rtmp_module.so \
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
&& rm -rf /usr/src/nginx-$NGINX_RTMP_MODULE_VERSION \
&& apk del .build-deps \
&& rm -f /etc/nginx/conf.d/*

COPY nginx.conf /etc/nginx/nginx.conf
COPY nginx-vh-*.conf /etc/nginx/conf.d/

EXPOSE 80 1935

STOPSIGNAL SIGTERM

CMD ["nginx", "-g", "daemon off;"]
44 changes: 44 additions & 0 deletions 1.2.1/nginx-stable/alpine/nginx-vh-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
15 changes: 15 additions & 0 deletions 1.2.1/nginx-stable/alpine/nginx-vh-rtmp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80 default_server;

location /rtmp/control {
allow 127.0.0.1;
deny all;
rtmp_control all;
}

location /rtmp/stat {
allow 127.0.0.1;
deny all;
rtmp_stat all;
}
}
38 changes: 38 additions & 0 deletions 1.2.1/nginx-stable/alpine/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load_module modules/ngx_rtmp_module.so;

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

rtmp {
server {
listen 1935;

application live {
live on;
}
}
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;

keepalive_timeout 65;

include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 25d61d8

Please sign in to comment.