diff --git a/deploy/nginx/testing.crm.aduanasoft.com.conf b/deploy/nginx/testing.crm.aduanasoft.com.conf index af625f2..5e15101 100644 --- a/deploy/nginx/testing.crm.aduanasoft.com.conf +++ b/deploy/nginx/testing.crm.aduanasoft.com.conf @@ -29,9 +29,8 @@ server { # ---- HTTPS ---- server { - listen 443 ssl; - listen [::]:443 ssl; - http2 on; + listen 443 ssl http2; + listen [::]:443 ssl http2; server_name testing.crm.aduanasoft.com; ssl_certificate /etc/letsencrypt/live/testing.crm.aduanasoft.com/fullchain.pem; @@ -50,6 +49,13 @@ server { # Subida de documentos (máx. 25 MB en la app) + margen client_max_body_size 30m; + # Buffers grandes para headers de respuesta: /auth/sso setea el JWT (fragmentado + # si supera ~4KB) + refresh/id_token/tenant como cookies → el header excede el + # buffer default de nginx (evita "upstream sent too big header" → 502). + proxy_buffer_size 32k; + proxy_buffers 16 32k; + proxy_busy_buffers_size 64k; + gzip on; gzip_types text/plain text/css application/javascript application/json image/svg+xml; gzip_min_length 1024; diff --git a/frontend/Dockerfile.prod b/frontend/Dockerfile.prod index 910a3eb..5ebeead 100644 --- a/frontend/Dockerfile.prod +++ b/frontend/Dockerfile.prod @@ -38,6 +38,9 @@ ENV INTERNAL_API_URL=${INTERNAL_API_URL} # Copiar el resto del código COPY . . +# Subir el límite de heap de Node para el build (VM chico → evita OOM en vite build) +ENV NODE_OPTIONS="--max-old-space-size=3072" + # Construir el proyecto RUN pnpm run build @@ -49,11 +52,8 @@ FROM node:22-alpine AS runtime WORKDIR /app -# wget de busybox ya viene en alpine; el apk es best-effort (redes restringidas sin CDN de Alpine) -RUN apk add --no-cache wget || true - -RUN npm config set strict-ssl false && \ - npm install -g pnpm +# Runtime SIN dependencias de red (redes restringidas): busybox ya trae wget y +# se arranca con node directo (sin pnpm), así el runtime no toca apk/npm. # Crear usuario no-root para seguridad antes de copiar con --chown RUN addgroup -g 1001 -S nodejs @@ -86,5 +86,5 @@ ENV INTERNAL_API_URL=http://backend:8000/api/ ENTRYPOINT ["/entrypoint.sh"] -# Ejecutar aplicación con Node.js -CMD ["pnpm", "start"] +# Ejecutar aplicación con Node.js (adapter-node, sin pnpm) +CMD ["node", "build/index.js"]