Skip to content

datagutt/docker-nginx-rtmp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-nginx-rtmp

A Dockerfile installing NGINX and nginx-rtmp-module from source with default settings for IRL-streaming. Built on Alpine Linux.

  • Nginx 1.25.0 (Mainline version compiled from source)
  • nginx-rtmp-module (Dev branch of Sergey-fork compiled from source)
  • Default IRL-streaming settings (See: nginx.conf)

Docker Stars Docker Pulls Docker Automated build Build Status

Usage

Server

  • Pull docker image and run:
docker pull datagutt/nginx-rtmp
docker run -it -p 1935:1935 -p 8080:80 --rm datagutt/nginx-rtmp

or

  • Build and run container from source:
docker build -t nginx-rtmp .
docker run -it -p 1935:1935 -p 8080:80 --rm nginx-rtmp
  • Stream live content to:
rtmp://localhost:1935/publish/$STREAM_NAME?psk=secret

SSL

To enable SSL, see nginx.conf and uncomment the lines:

listen 443 ssl;
ssl_certificate     /opt/certs/example.com.crt;
ssl_certificate_key /opt/certs/example.com.key;

This will enable HTTPS using a self-signed certificate supplied in /certs. If you wish to use HTTPS, it is highly recommended to obtain your own certificates and update the ssl_certificate and ssl_certificate_key paths.

I recommend using Certbot from Let's Encrypt.

Environment Variables

This Docker image uses envsubst for environment variable substitution. You can define additional environment variables in nginx.conf as ${var} and pass them in your docker-compose file or docker command.

Custom nginx.conf

If you wish to use your own nginx.conf, mount it as a volume in your docker-compose or docker command as nginx.conf.template:

volumes:
  - ./nginx.conf:/etc/nginx/nginx.conf.template

OBS Configuration

  • Stream Type: Custom Streaming Server
  • URL: rtmp://localhost:1935/publish
  • Stream Key: hello?psk=secret

Watch Stream

  • FFplay: ffplay -fflags nobuffer rtmp://localhost:1935/publish/hello

*This image is experimental!

Resources

About

🐋 A Dockerfile for nginx-rtmp-module from source with basic settings for IRL-streaming. Built on Alpine Linux.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • XSLT 83.7%
  • Dockerfile 16.3%