Reorganised the webservers (temp for now) and docker-compose.yml now works
This commit is contained in:
@@ -1,26 +1,7 @@
|
||||
FROM ubuntu:22.04
|
||||
FROM tiangolo/nginx-rtmp
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
libpcre3 libpcre3-dev \
|
||||
libssl-dev \
|
||||
zlib1g-dev \
|
||||
wget git
|
||||
|
||||
# Download and build NGINX with RTMP
|
||||
RUN wget http://nginx.org/download/nginx-1.25.2.tar.gz && \
|
||||
tar -xzvf nginx-1.25.2.tar.gz && \
|
||||
git clone https://github.com/arut/nginx-rtmp-module.git && \
|
||||
cd nginx-1.25.2 && \
|
||||
./configure --add-module=../nginx-rtmp-module --with-http_ssl_module && \
|
||||
make && make install
|
||||
|
||||
# Copy custom NGINX configuration
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 1935 8080
|
||||
|
||||
# Expose RTMP and HTTP ports
|
||||
EXPOSE 1935
|
||||
|
||||
# Start NGINX
|
||||
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
|
||||
# Start the Nginx server
|
||||
CMD [ "nginx", "-g", "daemon off;" ]
|
||||
|
||||
@@ -1,12 +1,43 @@
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
rtmp {
|
||||
|
||||
server {
|
||||
listen 1935;
|
||||
chunk_size 4096;
|
||||
listen 1935; # RTMP listen port
|
||||
|
||||
application live {
|
||||
live on;
|
||||
record off;
|
||||
|
||||
# HLS Configuration (optional)
|
||||
hls on; # Enable HLS conversion
|
||||
hls_path /tmp/hls; # Path to store HLS files (use an absolute path)
|
||||
hls_nested on;
|
||||
hls_fragment 5s; # Duration of each HLS segment
|
||||
hls_playlist_length 30s; # Length of HLS playlist (total duration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
http {
|
||||
# Enable HLS
|
||||
server {
|
||||
listen 8080;
|
||||
|
||||
location /hls/ {
|
||||
types {
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
video/mp2t ts;
|
||||
}
|
||||
|
||||
root /tmp;
|
||||
add_header Cache-Control no-cache;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
|
||||
autoindex on; # Enable directory indexing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user