/nginx-php

NGINX, PHP and Nginx RTMP Module Docker image based on Alpine Linux :whale2:

Primary LanguageHTML

Latest Version Docker Size Docker Pulls Build Status

About

NGINX, PHP and Nginx RTMP Module Docker image based on Alpine Linux.


Features

Supported platforms

  • linux/amd64
  • linux/arm64
  • linux/arm/v7

Usage

Docker Compose

Docker compose is the recommended way to run this image. Edit the compose file with your preferences and run the following command:

git clone https://github.com/k44sh/nginx-php.git
mkdir {config,data}
docker-compose up -d
docker-compose logs -f

Upgrade

To upgrade, pull the newer image and launch the container:

docker-compose pull
docker-compose up -d

Command line

You can also use the following minimal command:

docker run -d --name nginx-php \
  --ulimit nproc=65535 \
  --ulimit nofile=32000:40000 \
  -p 80:8080 \
  -p 1935:1935 k44sh/nginx-php:latest && \
  docker logs -f nginx-php

Configuration

Environment variables

  • TZ: The timezone assigned to the container (default UTC)
  • PUID: User id (default 1000)
  • PGID: User group id (default 1000)
  • MEMORY_LIMIT: PHP memory limit (default 512M)
  • UPLOAD_MAX_SIZE: Upload max size (default 16M)
  • CLEAR_ENV: Clear environment in FPM workers (default yes)
  • OPCACHE_MEM_SIZE: PHP OpCache memory consumption (default 256)
  • MAX_FILE_UPLOADS: The maximum number of files allowed to be uploaded simultaneously (default 50)

RTMP (Streaming)

  • /var/www/default/stream/play.php: Internal authentication to add an authentication when publishing a stream
  • /var/www/default/stream/publish.php: Internal authentication to add authentication to watch a stream
// Accounts
$accounts  =  array(
  0  =>  array(
    "name"  =>  "user1",
    "pass"  =>  "xxxxxxxxxxxxxxxx"
  ),
[...]

You can configure OBS like this:

  • Server Example: rtmp://192.168.1.1/stream
  • Key Example: user1?name=user1&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OBS Config

You can watch a stream like this:

  • Network URL: rtmp://192.168.1.1/stream/user1?name=user1&pass=xxxxxxxxxxxxxxxx

VLC Config

If you want remove authentication, just comment the following directives in nginx.conf:

Documentation: https://github.com/arut/nginx-rtmp-module/wiki/Directives