fixing dockerfile again
All checks were successful
Homepage Build and Deploy / Build Homepage Image (push) Successful in 10m13s
Homepage Build and Deploy / Deploy Homepage (push) Successful in 30s

This commit is contained in:
2025-11-24 06:56:30 -03:00
parent fdb75385cb
commit a376c8157a
3 changed files with 15 additions and 51 deletions

View File

@@ -1,20 +1,20 @@
FROM nginx:alpine-slim
FROM node:alpine AS build
WORKDIR /src
COPY . /src
# Install terser to minify JS files
RUN npm install -g terser
RUN if [ -d "js" ]; then find js -type f -name "*.js" -exec sh -c 'for f; do terser "$f" -c -m -o "$f"; done' sh {} +; fi
FROM nginx:alpine-slim AS final
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Copy website files
COPY . /usr/share/nginx/html
# Copy minify script and make it executable
COPY ./utils/minify.sh /tmp/minify.sh
RUN chmod +x /tmp/minify.sh
# Minify all JavaScript files in-place
RUN find /usr/share/nginx/html -name "*.js" -type f -exec sh /tmp/minify.sh {} \; && \
rm -r /tmp && \
rm -r /usr/share/nginx/html/.git && \
rm -r /usr/share/nginx/html/utils
COPY --from=build /src/js /usr/share/nginx/html/js
EXPOSE 80