From 03decdcede351e36fd012f7dfc3aab1e8832bda8 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Mon, 3 Mar 2025 21:03:21 +0000 Subject: [PATCH] REFACTOR: made custom nginx module instead of prebuilt --- nginx/Dockerfile | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 7830c79..d4440c5 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,7 +1,36 @@ -FROM tiangolo/nginx-rtmp +FROM debian:bullseye -COPY nginx.conf /etc/nginx/nginx.conf +# Install dependencies +RUN apt update && apt install -y \ + build-essential \ + libpcre3 libpcre3-dev \ + zlib1g zlib1g-dev \ + libssl-dev \ + curl wget git + +# Define versions +ENV NGINX_VERSION=1.24.0 +ENV NGINX_RTMP_MODULE_VERSION=1.2.2 + +# Download and compile NGINX with RTMP & auth_request module +RUN wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ + tar -zxvf nginx-${NGINX_VERSION}.tar.gz && \ + git clone https://github.com/arut/nginx-rtmp-module.git && \ + cd nginx-${NGINX_VERSION} && \ + ./configure --with-http_auth_request_module --add-module=../nginx-rtmp-module && \ + make -j$(nproc) && \ + make install + +# Create required directories for logs +RUN mkdir -p /var/log/nginx && \ + touch /var/log/nginx/error.log && \ + touch /var/log/nginx/access.log + +# Copy custom NGINX config +COPY nginx.conf /usr/local/nginx/conf/nginx.conf + +# Expose necessary ports EXPOSE 1935 8080 -# Start the Nginx server -CMD [ "nginx", "-g", "daemon off;" ] +# Start NGINX +CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"] \ No newline at end of file