Initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
conf/*
|
||||||
39
Dockerfile
Normal file
39
Dockerfile
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
FROM ubuntu:xenial
|
||||||
|
|
||||||
|
# Building in the docker image increases the size because all the deps are installed
|
||||||
|
# if these are done in separate RUN commands they get put into diff. layers and removing later has no effect apparently
|
||||||
|
# as a result, all build/remove commands are pushed into one RUN command, the docker image goes from 808 MB to 300 by doing so
|
||||||
|
RUN apt-get -y update; \
|
||||||
|
apt-get -y install software-properties-common dpkg-dev git; \
|
||||||
|
add-apt-repository -y ppa:nginx/stable; \
|
||||||
|
sed -i '/^#.* deb-src /s/^#//' /etc/apt/sources.list.d/nginx-ubuntu-stable-xenial.list; \
|
||||||
|
apt-get -y update; \
|
||||||
|
apt-get -y source nginx; \
|
||||||
|
cd $(find . -maxdepth 1 -type d -name "nginx*") && \
|
||||||
|
ls -ahl && \
|
||||||
|
git clone https://github.com/arut/nginx-rtmp-module.git && \
|
||||||
|
sed -i "s|common_configure_flags := \\\|common_configure_flags := \\\--add-module=$(cd nginx-rtmp-module && pwd) \\\|" debian/rules && \
|
||||||
|
cat debian/rules && echo "^^" && \
|
||||||
|
apt-get -y build-dep nginx && \
|
||||||
|
dpkg-buildpackage -b && \
|
||||||
|
cd .. && ls -ahl && \
|
||||||
|
dpkg --install $(find . -maxdepth 1 -type f -name "nginx-common*") && \
|
||||||
|
dpkg --install $(find . -maxdepth 1 -type f -name "libnginx*") && \
|
||||||
|
dpkg --install $(find . -maxdepth 1 -type f -name "nginx-full*"); \
|
||||||
|
apt-get -y remove software-properties-common dpkg-dev git; \
|
||||||
|
apt-get -y install aptitude; \
|
||||||
|
aptitude -y markauto $(apt-cache showsrc nginx | sed -e '/Build-Depends/!d;s/Build-Depends: \|,\|([^)]*),*\|\[[^]]*\]//g'); \
|
||||||
|
apt-get -y autoremove; \
|
||||||
|
apt-get -y remove aptitude; \
|
||||||
|
apt-get -y autoremove; \
|
||||||
|
rm -rf ./*nginx*
|
||||||
|
|
||||||
|
# forward request and error logs to docker log collector
|
||||||
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log
|
||||||
|
RUN ln -sf /dev/stderr /var/log/nginx/error.log
|
||||||
|
RUN rm /etc/nginx/modules-enabled/50-mod-rtmp.conf
|
||||||
|
|
||||||
|
EXPOSE 80 443 1935
|
||||||
|
VOLUME ["/etc/nginx", "/var/cache/nginx"]
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
11
Dockerfile.alpine
Normal file
11
Dockerfile.alpine
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM alpine:3.13.4 as builder
|
||||||
|
RUN apk add --update build-base git bash gcc make g++ zlib-dev linux-headers pcre-dev openssl-dev
|
||||||
|
RUN git clone https://github.com/arut/nginx-rtmp-module.git && \
|
||||||
|
git clone https://github.com/nginx/nginx.git
|
||||||
|
RUN cd nginx && ./auto/configure --add-module=../nginx-rtmp-module && make && make install
|
||||||
|
|
||||||
|
FROM alpine:3.13.4 as nginx
|
||||||
|
RUN apk add --update pcre ffmpeg
|
||||||
|
COPY --from=builder /usr/local/nginx /usr/local/nginx
|
||||||
|
ENTRYPOINT ["/usr/local/nginx/sbin/nginx"]
|
||||||
|
CMD ["-g", "daemon off;"]
|
||||||
4
README.md
Normal file
4
README.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Nginx RTMP
|
||||||
|
|
||||||
|
A Docker container running nginx with RTMP module based on a [forum post by dodgepong](https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/) and the [RTMP module wiki](https://github.com/arut/nginx-rtmp-module/wiki/Building-a-docker-image-with-nginx--rtmp-module)
|
||||||
|
|
||||||
Reference in New Issue
Block a user