From 4fc1b4d5b976cf1b5df341271b65f1bada8610e9 Mon Sep 17 00:00:00 2001 From: mateusz779 Date: Thu, 7 Nov 2024 01:57:08 +0100 Subject: [PATCH] poprawa minifikacji --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index df8da75..49e22ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,11 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o main . # Etap minifikacji FROM node:alpine AS minifier WORKDIR /app -RUN npm install -g minify +RUN yarn global add html-minifier clean-css-cli terser COPY public/ ./public/ -RUN find ./public -name "*.html" -exec minify -o {} {} \; -RUN find ./public/css -name "*.css" -exec minify -o {} {} \; -RUN find ./public/js -name "*.js" -exec minify -o {} {} \; +RUN find ./public -name "*.html" -exec html-minifier --collapse-whitespace --remove-optional-tags --minify-js true --minify-css true {} -o {} \; +RUN find ./public/css -name "*.css" -exec cleancss -o {} {} \; +RUN find ./public/js -name "*.js" -exec terser {} --compress --mangle --output {} \; FROM alpine:latest RUN apk --no-cache add ca-certificates