Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-01-19 01:19:45 +00:00
parent 94063af0e4
commit efb202577e
2 changed files with 4 additions and 7 deletions

View File

@ -9,3 +9,4 @@
* Frontend - Decide what to do with Bus Services. * Frontend - Decide what to do with Bus Services.
* Frontend - Implement error pages - will need to look at including these on the proxy container too? * Frontend - Implement error pages - will need to look at including these on the proxy container too?
- https://expressjs.com/en/guide/error-handling.html - https://expressjs.com/en/guide/error-handling.html
* Building - Implement build process in dockerfile that minifies and then compresses the static source.

View File

@ -1,18 +1,14 @@
FROM fedora:latest as compressor FROM fedora:latest as compressor
RUN dnf install brotli -y RUN dnf install brotli nodejs npm -y && npm i uglify-js -g
COPY . /data/ COPY . /data/
RUN rm -r /data/nginx RUN rm -r /data/nginx
#RUN brotli -q 9 /data/*.json RUN uglifyjs /data/js/*.js --compress --mangle
RUN gzip -k -9 /data/*.json RUN gzip -k -9 /data/*.json
#RUN brotli -q 9 /data/styles/*.css
RUN gzip -k -9 /data/styles/*.css RUN gzip -k -9 /data/styles/*.css
#RUN brotli -q 9 /data/js/*.js
RUN gzip -k -9 /data/js/*.js RUN gzip -k -9 /data/js/*.js
#RUN brotli -q 9 /data/*.html
RUN gzip -k -9 /data/*.html RUN gzip -k -9 /data/*.html
FROM nginx:mainline-alpine-slim FROM nginx:mainline-alpine-slim
#RUN apk add nginx-mod-http-brotli
RUN rm /etc/nginx/nginx.conf RUN rm /etc/nginx/nginx.conf
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=compressor /data/ /site-static/ COPY --from=compressor /data/ /site-static/