A lightweight NGINX server optimized for video streaming, featuring VOD support, RTMP streaming, and thumbnail generation, all built on Alpine Linux for minimal footprint.
- Base Image: Alpine Linux 3.19.0
- Web Server: NGINX 1.26.1
- Image Size: Optimized for minimal footprint
- Streaming Protocols: HLS, DASH, RTMP
- Video Processing: Thumbnail generation, VOD support
amd64
/x86_64
: 64-bit Intel/AMDarm64v8
/aarch64
: 64-bit ARM (ARMv8)arm32v7
/armhf
: 32-bit ARM (ARMv7)
/var/media
: Video files and streaming content/var/log/nginx
: NGINX logs/etc/nginx/conf.d/
: Custom configuration files
80
: HTTP port443
: HTTPS port (configured but disabled by default)1935
: RTMP port
WORKER_PROCESSES
: Number of worker processes (default: auto)WORKER_CONNECTIONS
: Maximum connections per worker (default: 1024)CLIENT_MAX_BODY_SIZE
: Maximum upload size (default: 10m)
docker run -d \
--name nginx-streaming \
-p 80:80 \
-p 1935:1935 \
-v media:/var/media \
-v logs:/var/log/nginx \
hhftechnology/alpine-nginx-video-stream:latest
version: '3.8'
services:
nginx-streaming:
image: hhftechnology/alpine-nginx-video-stream:latest
ports:
- "80:80"
- "1935:1935"
volumes:
- ./media:/var/media
- ./logs:/var/log/nginx
- ./custom.conf:/etc/nginx/conf.d/custom.conf:ro
environment:
- WORKER_PROCESSES=auto
- WORKER_CONNECTIONS=1024
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
media:
driver: local
logs:
driver: local
docker service create \
--name nginx-streaming \
--publish 80:80 \
--publish 1935:1935 \
--mount type=volume,source=media,target=/var/media \
--mount type=volume,source=logs,target=/var/log/nginx \
--replicas 1 \
hhftechnology/alpine-nginx-video-stream:latest
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
hls on;
hls_path /var/media/hls;
dash on;
dash_path /var/media/dash;
}
}
}
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /var/media;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
ffmpeg -i input.mp4 -c:v copy -c:a aac -f flv rtmp://your-server:1935/live/stream
- HLS:
http://your-server/hls/stream.m3u8
- DASH:
http://your-server/dash/stream.mpd
- VOD:
http://your-server/vod/video.mp4
http://your-server/thumb?video=example.mp4&time=30&width=320&height=240
worker_processes auto;
worker_rlimit_nofile 65535;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
}
- Implement SSL/TLS for secure streaming
- Configure proper access controls
- Use secure RTMP keys
- Monitor streaming activity
- Regular security updates
- Implement rate limiting
- Configure proper file permissions
- Access logs:
/var/log/nginx/access.log
- Error logs:
/var/log/nginx/error.log
- RTMP statistics:
http://your-server/stat
- Health check:
http://your-server/health
- Issues: GitHub Issues
- Forum: HHF Technology Forum
- Contribute: Submit PRs to our GitHub repository
This project is licensed under the MIT License - see the LICENSE file for details.