Files
ivanch.me/Dockerfile
José Henrique ed7a82b44e
All checks were successful
Homepage Build and Deploy / Build Homepage Image (push) Successful in 11m10s
Homepage Build and Deploy / Deploy Homepage (push) Successful in 30s
general improvements
2025-11-25 21:04:17 -03:00

19 lines
436 B
Docker

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 nginx.conf /etc/nginx/nginx.conf
COPY . /usr/share/nginx/html
COPY --from=build /src/js /usr/share/nginx/html/js
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]