Sign inSign up

dylanlopez/pagespeed

By dylanlopez

Updated about 4 years ago

A PHP docker image file, quickly launch your webserver (with nginx pagespeed)

Image
0

10K+

dylanlopez/pagespeed repository overview

What features included ?

  • PHP 7.4.22 (cli) (built: Jul 27 2021 18:08:31) ( NTS )
  • PHP OPCACHE enabled
  • Nginx + mod Pagespeed (https://www.modpagespeed.com/) + GEO IP
  • Cron enabled (to schedule auto-backup files and database)

Getting Started

You can deploy this image on single docker container or docker swarm, the OS of this container is Centos 7

How to use this image ?

docker run -d -p 80:80 dylanlopez/pagespeed

Verify the PHP is working

Open your browser, load your server's IP address, you will see the phpinfo() page

Verify the nginx pagespeed is working

  • Open your browser, load http://YOUR_SERVER_IP/test.jpg , you will see a very big-size image, loaded progressively
  • Next, load http://YOUR_SERVER_IP/test.css , you will see a regular css page, reload the page few times, you will see the CSS file had been compressed and minified. that means the pagespeed engine is working

Where is the location of my public folder?

/usr/share/nginx/html/public

In this image, What Pagespeed Optimizations are enabled?

You can edit the nginx.conf file, located at /etc/nginx/nginx.conf , just remove the option that you want to disable, or add more optimizations

#Minify CSS,javascript
pagespeed EnableFilters rewrite_css;
pagespeed EnableFilters rewrite_javascript;

#combine CSS
pagespeed EnableFilters combine_css;

#Compress image
pagespeed EnableFilters recompress_images;
pagespeed EnableFilters sprite_images;

pagespeed EnableFilters make_google_analytics_async;

#Optimize for mobile
pagespeed EnableFilters resize_mobile_images;

#https://www.pagespeedguide.com/documentation/optimizations
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters lazyload_images;    
pagespeed EnableFilters convert_jpeg_to_progressive;
pagespeed EnableFilters convert_jpeg_to_webp;

#HTML
pagespeed EnableFilters remove_comments;

To learn more : https://www.pagespeedguide.com/documentation/optimizations

I want to disable nginx_pagespeed, how to do that?

Open the file /etc/nginx/nginx.conf , change pagespeed On; to pagespeed Off;

I have many .php files in my public folder, why does the server always load the index.php file?

By default, all request will forward to index.php file, you can remove this behavior by edit the /etc/nginx/nginx.conf file, look for

    location / {
        #Forward all request to index.php
        try_files $uri $uri/ /index.php?$args;
    }

and remove the line try_files $uri $uri/ /index.php?$args;

Where is php.ini file

/etc/php.ini

(More information will be provided soon...)

Tag summary

Content type

Image

Digest

Size

435 MB

Last updated

about 4 years ago

docker pull dylanlopez/pagespeed