Skip to content

sachk/docker-alpine-nginx-pagespeed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Supported tags and respective Dockerfile links

  • v1, v1.11, v1.11.33.3 and similar are tagged versions of Nginx PageSpeed (with a compatible Nginx).
  • latest (Dockerfile)

What is Nginx with PageSpeed Module

This is a Dockerized image of Nginx with PageSpeed Module based on Alpine Linux.

PageSpeed Module (for Nginx) (aka ngx_pagespeed) performs a lot of optimizations for websites by default (i.e. without doing anything outside of switching Nginx with this version) like:

  • Minify CSS/JS/HTML/images resources (e.g. recompressed images to webp if the client's browser supports it).
  • Cache and prioritize visible content or defer JavaScript.
  • Combine or inline CSS/JavaScript.
  • Flush resources early
  • Clean-up HTML by removing unnecessary tags.
  • ...

You can see PageSpeed documentation for more details and settings.

Usage example

Configuration is very similar to the official Nginx image.

$ docker run -d -p 80:80 wernight/alpine-nginx-pagespeed

You probably want to create a Dockerfile based on this image or mount required resources. Most importantly you'd want to customize /etc/nginx/nginx.conf and mount static files to your web root (e.g. /srv/).

Notes

There is already an official Nginx based on Alpine Linux however there is no current simple way to add mod PageSpeed to it. We need to build it together with Nginx, and the smallest image for that, supporting automated builds on Docker Hub, is Linux Alpine.

There is also no official build documentation for Alpine Linux (see ngx_pagespeed #1181).

Feedbacks

Suggestions are welcome on our GitHub issue tracker.

About

Dockerized Nginx with PageSpeed Module on Alpine Linux

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 100.0%