Docker image with NGINX Unit and PHP 7 module installed.
- Ready to use - just run container and copy your files.
- Small - based on alpine Linux it's smaller then images built from CentOS, Ubuntu and Debian.
- Extensible - only a few lines of code to start powerful php7 applications.
- Start it with
$ docker run -dit -p 80:8300 --name unit vladkras/nginx-unit-php7
- Configure php
$ docker exec unit curl -X PUT -d @/config.json --unix-socket /run/control.unit.sock http://localhost/config/
and open http://localhost - you'll see phpinfo(). To try your own files add:
-v "/path/to/your/code:/app/default"
default
- is the name of this default app, so files are stored in /app/default
. Check config.json and official docs for more info.
$ git clone https://github.com/vladkras/nginx-unit-php7.git
$ cd nginx-unit-php7
$ docker pull vladkras/nginx-unit-base:latest
now modify config.json and
$ docker build -t vladkras/nginx-unit-php7 .
Don't forget to send config.json to Unit’s control API
This image uses vladkras/nginx-unit-base that already has git, curl and NGINX Unit installed from source. Dockerfile along with entrypoint.sh undergo these steps:
- PHP is installed
- Source code is located in
/unit
dir, that's whyWORKDIR
is changed first - PHP module is configured and installed for NGINX unit
- unitd is launched with path to modules = $DESTDIR + "modules"
This package is licensed under MIT License and contains NGINX Unit licensed under Apache License 2.0