nginx-streamer/Dockerfile

52 lines
1.8 KiB
Docker
Raw Permalink Normal View History

2020-09-19 22:30:25 +02:00
FROM buildpack-deps:stable
2020-09-19 21:46:46 +02:00
2022-04-12 21:10:20 +02:00
ENV NGINX_VERSION nginx-1.21.6
2020-09-19 21:46:46 +02:00
2020-09-20 03:12:53 +02:00
ADD startscript.sh /usr/sbin/startscript.sh
ADD config /etc/nginx/
2020-09-19 21:46:46 +02:00
RUN apt-get update && \
apt-get install -y ca-certificates openssl libssl-dev ffmpeg && \
2020-09-19 22:16:40 +02:00
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p /tmp/build/ && \
2020-09-19 22:05:25 +02:00
cd /tmp/build/ && \
2020-09-19 21:46:46 +02:00
wget -O ${NGINX_VERSION}.tar.gz https://nginx.org/download/${NGINX_VERSION}.tar.gz && \
2020-09-19 22:16:40 +02:00
tar -zxf ${NGINX_VERSION}.tar.gz &&\
git clone https://github.com/sergey-dryabzhinsky/nginx-rtmp-module.git &&\
cd /tmp/build/${NGINX_VERSION} && \
2020-09-19 21:46:46 +02:00
./configure \
--sbin-path=/usr/local/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx/nginx.lock \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/tmp/nginx-client-body \
--with-http_ssl_module \
--with-threads \
2020-09-19 22:05:25 +02:00
--with-select_module \
--with-poll_module \
--with-file-aio \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_ssl_preread_module \
--with-compat \
--add-module=../nginx-rtmp-module \
--with-debug\
2020-09-19 22:32:57 +02:00
--builddir=${NGINX_VERSION} && \
2020-09-19 21:46:46 +02:00
make -j $(getconf _NPROCESSORS_ONLN) && \
make install && \
mkdir /var/lock/nginx && \
2020-09-19 22:16:40 +02:00
rm -rf /tmp/build && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
2020-09-20 03:12:53 +02:00
ln -sf /dev/stderr /var/log/nginx/error.log && \
useradd -r -d /var/cache/nginx/ -s /sbin/nologin -U nginx && \
ln -sf /usr/lib64/nginx/modules /etc/nginx/modules && \
2020-09-20 03:35:04 +02:00
chown -R nginx:users /etc/nginx
2020-09-19 21:55:02 +02:00
2020-09-20 03:12:53 +02:00
USER nginx:users
2020-09-19 21:46:46 +02:00
EXPOSE 1935
CMD ["bash", "/usr/sbin/startscript.sh"]