Docker file do create and build a nginx image with ng_pagepeed module compiled together.
You can configure the container using those environment variables.
Notice: The container must be started with the environment variables set correctly. Any change made on the environment variables after the container is runnig will be disconsidered.
The nginx environment variables start with
Set the log levevel you want to be expoded by the nginx error logs.
Set the name of the nginx upstream server.
The server that will respond to the upstream.
Page speed module settings:
The following settings use the same names as the settings created by Google on the page speed module. The only difference is that the environment variables are all prepended with
Notice: Not all settings are available yet. We are working on that.
For more information, visit Google's page speed module configurarion page here.
Enable or disable the page speed module completely.
We changed a lot since the original version. Now we have expoded the volume with the nginx.conf to give you more flexibility. All the environment variables were removed and now are set directly on the nginx.conf file. just map the volume /opt/nginx/conf/ to some folder on your machine and you can change the file freely.
docker run -it -p 8080:80 -v ~/ngx_pagespeed/conf:/opt/nginx/conf/ jmtvms/ngx_pagespeed
The main idea of this image is to test ngx_pagespeed in action, it only exposes the por 80(HTTP). We are working to make it work on 443(HTTPS).
How to use it
As it is
To use the image as it is just start the container
docker run -it -p 8080:80 jmtvms/ngx_pagespeed
Set different configuration
To use this container using different configuration you can set any environment variables using the parameter
docker run -it -p 8080:80 -e "NPS_ENABLED=off" jmtvms/ngx_pagespeed
This will start the container but the page speed module will be disabled.
After the container is created you can just use go to
http://localhost:8080 and see it working.
The volume where the nginx.conf file is located. just remember to reload the configuration file everytime you change something.
You can add some static files in this folder to be served by the nginx server.
Most of the logs are shown on the container console but you can have access to the folder directly if you configure any other log on the configuration file.