feature(DOCKERFILE): set up nginx to run as non-root

- add libcap
- use setcap (via libcap) to allow nginx to bind to ports <1024
- set permissions on nginx directories
- change nginx pid location to /etc/nginx
This commit is contained in:
Asif Bacchus
2021-01-07 10:06:17 -07:00
parent 53ea4c9dc1
commit 715ae9cd38
2 changed files with 15 additions and 12 deletions
+3 -4
View File
@@ -2,9 +2,8 @@
### NGINX main configuration
#
user www-docker;
worker_processes 1;
pid /var/run/nginx.pid;
pid /etc/nginx/nginx.pid;
error_log /var/log/nginx/error.log warn;
@@ -12,13 +11,13 @@ error_log /var/log/nginx/error.log warn;
include /etc/nginx/modules/*.conf;
events {
worker_connections 512;
worker_connections 1024;
multi_accept off;
use epoll;
}
http {
server_names_hash_bucket_size 512;
server_names_hash_bucket_size 128;
default_type application/octet-stream;
charset utf-8;
include /etc/nginx/mime.types;