Compare commits

..

No commits in common. "224891d2b5ab6301db49415316ad49385d0fef77" and "65f23aee56e47530d2b8b03a7430f2905e1bb648" have entirely different histories.

5 changed files with 15 additions and 59 deletions

View File

@ -1,43 +0,0 @@
#!/bin/bash
ROOTIN="/data/in"
ROOTOUT="/data/out"
echo "Running UglifyJS on /data/in folder"
uglifyjs-folder "$ROOTIN" -x ".js" -eo "$ROOTOUT"
echo "Running UglifyCSS"
CSSIN="/data/in/style/"
CSSOUT="/data/out/style"
cd $CSSIN
echo "Changed directory"
for f in *
do
if [ -f "$f" ]; then
uglifycss "$f" --output "$f";
fi
done
echo "Moving 'styles' to 'out'"
cp -r $CSSIN $CSSOUT
echo "Running html-minifier-terser on /folder"
HTMLIN="/data/in/"
HTMLOUT="/data/out"
html-minifier-terser --collapse-whitespace --remove-comments --file-ext html --input-dir /data/in/ --output-dir /data/out/
#echo "Moving JSON Manifest file from root to output"
#cat /data/in/manifest.json | jq -c > /data/out/manifest.json
echo "Moving other files folder from in/ to out/"
cp -r /data/in/images /data/out/images
cp -r /data/in/error-pages/*.php /data/out/error-pages/
cp -r /data/in/downloads /data/out/downloads
cp -r /data/in/*.php /data/out/
cp -r /data/in/*.ico /data/out/
cp -r /data/in/page-blocks /data/out/page-blocks
cp -r /data/in/php /data/out/php
echo "Running GZIP & Brotli on all HTML, JS, CSS, JSON, SVG, TTF, VCF, PUB files"
find /data/out -type f -name \*.html -or -name \*.vcf -or -name \*.pub -or -name \*.js -or -name \*.css -or -name \*.json -or -name \*.svg -or -name \*.ttf | while read file; do gzip -k -9 $file; brotli -k -q 11 $file; done

View File

@ -7,5 +7,6 @@ EMAIL;CHARSET=UTF-8;type=HOME,INTERNET:fred@fjla.uk
TEL;TYPE=HOME,VOICE:03331126831 TEL;TYPE=HOME,VOICE:03331126831
ADR;CHARSET=UTF-8;TYPE=HOME:;;;Bath;;;United Kingdom ADR;CHARSET=UTF-8;TYPE=HOME:;;;Bath;;;United Kingdom
URL;CHARSET=UTF-8:https://fredboniface.co.uk URL;CHARSET=UTF-8:https://fredboniface.co.uk
NOTE;CHARSET=UTF-8:vCard generated at vcardmaker.com
REV:2022-10-06T21:38:40.052Z REV:2022-10-06T21:38:40.052Z
END:VCARD END:VCARD

View File

@ -9,6 +9,11 @@
<?php include "./page-blocks/menu.php"; ?> <?php include "./page-blocks/menu.php"; ?>
<?php include "./page-blocks/micro-content.php"; ?> <?php include "./page-blocks/micro-content.php"; ?>
<div class="content hide_micro"> <div class="content hide_micro">
<h2>Website Migration</h2>
<p>
I am migrating this website to Kubernetes, it may become temporarily
unavailable and HTTPS connections may fail over the next 24 hours.
</p>
<p> <p>
Hello, I'm Fred, a <?php echo getAge(1993,11); ?> year old Hello, I'm Fred, a <?php echo getAge(1993,11); ?> year old
rail professional and Local RMT Rep. I don't intend for rail professional and Local RMT Rep. I don't intend for

View File

@ -1,12 +1,4 @@
FROM fedora:latest as compressor FROM nginx:mainline-alpine-slim
RUN dnf install brotli nodejs npm jq -y
RUN npm i uglifyjs-folder uglifycss html-minifier-terser -g
COPY . /data/in
RUN bash /data/in/conf/deploy.sh
FROM fholzer/nginx-brotli:latest
RUN rm /etc/nginx/nginx.conf RUN rm /etc/nginx/nginx.conf
RUN apk update COPY ./nginx.conf /etc/nginx/nginx.conf
RUN apk add --upgrade libxml2 libxslt COPY . /site
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
COPY --from=compressor /data/out/ /site/

View File

@ -1,12 +1,12 @@
user nginx; user nginx;
worker_processes 1; worker_processes auto;
error_log /var/log/nginx/error.log notice; error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid; pid /var/run/nginx.pid;
events { events {
worker_connections 128; worker_connections 1024;
} }
http { http {
@ -19,7 +19,8 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
gzip_static on; gzip_static on;
brotli_static on; gzip on;
gzip_types text/html text/css application/json text/javascript text/plain font/ttf;
server { server {
listen 80; listen 80;
@ -36,7 +37,7 @@ http {
index index.php; index index.php;
try_files $uri $uri/ $uri/index.php &uri/index.html =404; try_files $uri $uri/ $uri/index.php &uri/index.html =404;
break; break;
expires 7d; expires 4320;
} }
location ~ \.php$ { location ~ \.php$ {