Skip to content
/ nginx Public

Docker of the NGINX web server based on Alpine Linux

License

Notifications You must be signed in to change notification settings

k44sh/nginx

Repository files navigation

Alpine Linux Build Status Github Stars License

Latest Version Docker Size Docker Pulls

About

Docker of the NGINX web server based on Alpine Linux


Features

Modules

Module Desctiption
nginx-mod-http-brotli Serves compressed responses with brotli (Google)
nginx-mod-http-auth-jwt Client authorization (JSON Web Token (JWT) / OpenID Connect)
nginx-mod-http-cookie-flag Set the flags HttpOnly, secure and SameSite for cookies
nginx-mod-http-dav-ext Additional implementation for full WebDav compatibility
nginx-mod-http-fancyindex Like the built-in autoindex module, but fancier
nginx-mod-http-geoip2 City and country code lookups via the MaxMind GeoIP2
nginx-mod-http-headers-more Set and clear input and output headers
nginx-mod-http-vts Virtual host and upstream traffic status
nginx-mod-rtmp RTMP protocol support. Live streaming and video on demand

Example

VTS Module

Multi Platform Images

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

Environment Variables

Variable Desctiption
TZ The timezone assigned to the container (default UTC)
PORT NGINX listening port (default 8080)
PUID NGINX user id (default 1000)
PGID NGINX group id (default 1000)
MM_ACCOUNT Your MaxMind account ID
MM_LICENSE Your MaxMind license key

ℹ️ In the absence of MaxMind (GeoIP2) information, there will be no cron for updating the database

Volumes

  • /config: NGINX configuration files /etc/nginx
  • /data: NGINX web content files /var/www

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:

mkdir $(pwd)/{config,data}
docker compose up -d
docker compose logs -f

Start

You can also use the following minimal command:

docker run -d --name nginx -p 80:8080 k44sh/nginx:latest 
docker logs -f nginx

Or this one for more customization:

mkdir $(pwd)/{config,data}
docker run -d --name nginx \
  --ulimit nproc=65535 \
  --ulimit nofile=32000:40000 \
  -p 80:8000/tcp \
  -e TZ="America/Toronto" \
  -e PORT="8000" \
  -e PUID=1002 \
  -e PGID=1002 \
  -e MM_ACCOUNT="xxxxxx" \
  -e MM_LICENSE="xxxxxxxxxxxx" \
  -v $(pwd)/config:/config \
  -v $(pwd)/data:/data \
  k44sh/nginx && \
  docker logs -f nginx

Upgrade

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

docker compose pull
docker compose up -d

Cleanup

docker compose down -v
rm -rf $(pwd)/{config,data}