funkygibbon/nginx-pagespeed
nginx + ngx_pagespeed + openssl on docker-friendly Ubuntu, customisable by environment variables
10K+
Built on funkygibbon/ubuntu, a lightly modified Ubuntu Xenial Phusion Base Image.
docker run -v "/path/to/www:/app/www" -p "80:80" -p "443:443" funkygibbon/nginx-pagespeed
Files are served from /app/www/
, SSL certificates are generated in /etc/nginx/ssl
, /etc/nginx/sites-enabled/*
is searched for virtual hosts.
Nginx is configured with sane security defaults for out-of-the-box webservice, highly configurable by environment variables and is compiled from mainline source.
Nginx is configurable via environment variables, which are re-applied to the configuration on service start, so you can adjust server parameters at container start with:
docker run -e "UPLOAD_MAX_SIZE=50M" funkygibbon/nginx-pagespeed
A minimal docker-compose.yml file:
version: '2'
services:
app:
image: funkygibbon/nginx-pagespeed
ports:
- "80:80"
- "443:443"
volumes:
- /path/to/www:/app/www
variable | default | description |
---|---|---|
APP_USER | nginx | Service user name |
APP_GROUP | nginx | Service group name |
UPLOAD_MAX_SIZE | 30M | Sets nginx_client_max_body_size |
NGINX_MAX_WORKER_PROCESSES | 8 | Sets worker_processes , defaults to largest of eight, or the number available cores |
CHOWN_APP_DIR | false | If true chown /app/www as APP_USER:APP_GROUP |
Nginx is compiled from mainline source according to Ubuntu compile flags, with the following modifications:
http_ssi_module
and http_autoindex_module
disabledHTTPS is configured using modern sane defaults, including
/etc/nginx/ssl/default.key
/etc/nginx/ssl/default.crt
. To install your own certificates I recommend bind-mounting ssl
and sites-enabled
folders.${APP_USER:-$DEFAULT_APP_USER}
(default is nginx){APP_USER:-$DEFAULT_APP_USER}:${APP_GROUP:-$DEFAULT_APP_GROUP}
, some sanity checks for matching UID / GID in the event that user/group already exists${CHOWN_APP_DIR:-$DEFAULT_CHOWN_APP_DIR}
is true, chown -R ${APP_USER:-$DEFAULT_APP_USER}:${APP_GROUP:-$DEFAULT_APP_GROUP} /app/www
(default false)worker_processes
is set to the number of available processor cores and adjusts /etc/nginx/nginx.conf
to match, up to a maximum number of cores ${NGINX_MAX_WORKER_PROCESSES:-$DEFAULT_MAX_WORKER_PROCESSES}
client_max_body_size
is set to ${UPLOAD_MAX_SIZE:-$DEFAULT_UPLOAD_MAX_SIZE}
docker pull funkygibbon/nginx-pagespeed