Docker of the NGINX web server based on Alpine Linux
- Latest version of NGINX from Alpine Linx
- s6-overlay process supervisor
- GeoIP2 database by MaxMind (Update with your own key)
- Run as non-root user
- Multi-platform image
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 |
linux/amd64
linux/arm64
linux/arm/v7
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
/config
: NGINX configuration files/etc/nginx
/data
: NGINX web content files/var/www
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
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
To upgrade, pull the newer image and launch the container:
docker compose pull
docker compose up -d
docker compose down -v
rm -rf $(pwd)/{config,data}