Docker to run nginx-unit
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf add nginx conf Sep 25, 2017
json add files Sep 13, 2017
mysql Automatically commit Sep 14, 2017
root Automatically commit Sep 23, 2017
run add files Sep 13, 2017
.gitignore update dockerfile Sep 14, 2017
Dockerfile Automatically commit Sep 23, 2017
README.md update readme Sep 25, 2017
docker-compose.yml Automatically commit Sep 23, 2017
entrypoint.sh Automatically commit Sep 23, 2017
nginx_signing.key initial commit Sep 12, 2017

README.md

NGINX Unit

NGINX Unit is a dynamic web application server, designed to run applications in multiple languages.

https://www.nginx.com/products/nginx-unit/

Supported tags and respective Dockerfile links

latest, 0.1.1 (docker/Dockerfile)

How to run

Run with docker-compose is rightly simple.

$ git clone https://github.com/yousan/nginx-unit
$ cd nginx-unit
$ docker-compose up

Socket file to connect unit server and json files to manage unit server are preserved.

$ sudo curl -X PUT -d @./json/wiki.json --unix-socket ./run/control.unit.sock http://localhost/ 

Docker

you can use docker command

$ docker run --name some-nginx-unit -d yousan/nginx-unit

Create root and run directories, mount those directories.

$ docker run --name some-nginx-unit -v /var/www:/www/root -v /var/run:/var/run:rw  -p 8200:8200 -p 8300:8300  yousan/nginx-unit

Send commands from Local

You can send curl requests from local host into docker container.

$ sudo curl -X PUT -d @./json/wiki.json --unix-socket ./run/control.unit.sock http://localhost/ 

Make sure directory (/var/run/) which have socket file (/var/run/control.sock) is bound.

memorandum for me

$ docker build --rm ./ -t yousan/nginx-unit && \
 docker-compose down && docker-compose up -d && \
 docker-compose exec nginx-unit curl -X PUT -d @/root/json/start.json --unix-socket /var/run/control.unit.sock http://localhost/ && \
 docker-compose exec nginx-unit /bin/bash