From d9f3de9468990eaabb2b74558aa048a8b4216c79 Mon Sep 17 00:00:00 2001 From: nessi Date: Fri, 13 Feb 2026 11:26:52 +0100 Subject: [PATCH] Use lighter base images for frontend containers Switched Node.js and Nginx images from 'bookworm' to 'alpine' variants to reduce image size. Added `apk upgrade --no-cache` for updated Alpine packages in the Nginx container. This optimizes resource usage and enhances performance. --- frontend/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d77aab8..3e539d3 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-bookworm-slim AS build +FROM node:22-alpine AS build WORKDIR /app COPY package.json package-lock.json* ./ RUN npm install @@ -7,7 +7,8 @@ ARG VITE_API_URL=/api/v1 ENV VITE_API_URL=${VITE_API_URL} RUN npm run build -FROM nginx:1.29-bookworm +FROM nginx:1.29-alpine-slim +RUN apk upgrade --no-cache COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 80