diff --git a/Dockerfile.frontend b/Dockerfile.frontend index 44446f9..81b53d2 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -25,9 +25,14 @@ ARG VITE_API_BASE_URL=/api RUN pnpm --filter admin-web build # ─── Stage 2: Serve with nginx ───────────────────────────────────────────────── -FROM nginx:1.27-alpine +FROM alpine:3.22 + +RUN apk add --no-cache nginx nginx-mod-http-brotli \ + && mkdir -p /run/nginx /usr/share/nginx/html COPY --from=builder /app/apps/admin-web/dist /usr/share/nginx/html -COPY apps/admin-web/nginx.conf /etc/nginx/conf.d/default.conf +COPY apps/admin-web/nginx.conf /etc/nginx/http.d/default.conf EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/Dockerfile.ops-web b/Dockerfile.ops-web index 3fb54ce..7a91287 100644 --- a/Dockerfile.ops-web +++ b/Dockerfile.ops-web @@ -17,9 +17,14 @@ COPY apps/ops-web/ ./apps/ops-web/ RUN pnpm --filter ops-web build -FROM nginx:1.27-alpine +FROM alpine:3.22 + +RUN apk add --no-cache nginx nginx-mod-http-brotli \ + && mkdir -p /run/nginx /usr/share/nginx/html COPY --from=builder /app/apps/ops-web/dist /usr/share/nginx/html -COPY apps/ops-web/nginx.conf /etc/nginx/conf.d/default.conf +COPY apps/ops-web/nginx.conf /etc/nginx/http.d/default.conf EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/admin-web/nginx.conf b/apps/admin-web/nginx.conf index 5451faa..92fd38e 100644 --- a/apps/admin-web/nginx.conf +++ b/apps/admin-web/nginx.conf @@ -41,5 +41,9 @@ server { } gzip on; + gzip_static on; + gzip_vary on; gzip_types text/plain text/css application/json application/javascript text/xml; + + brotli_static on; } diff --git a/apps/ops-web/nginx.conf b/apps/ops-web/nginx.conf index e50288e..261964c 100644 --- a/apps/ops-web/nginx.conf +++ b/apps/ops-web/nginx.conf @@ -29,4 +29,6 @@ server { gzip_static on; gzip_vary on; gzip_types text/plain text/css application/json application/javascript text/xml; + + brotli_static on; }