From 321e3e3f756b6963c88f20961de5df44e2b982b4 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sun, 12 Apr 2026 16:17:58 -0400 Subject: [PATCH] fix: cap image sizes and increase memory limit to stop 502 crash loop Next.js image optimization was generating 3840px images that caused the container to exceed its 128MB memory limit, triggering repeated restarts. Capped deviceSizes to max 1200px and bumped mem_limit to 256MB. Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 1 + next.config.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 328a3a9..897dc4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: container_name: xhivart-mirror init: true restart: always + mem_limit: 256m environment: - SMTP_HOST=${SMTP_HOST} - SMTP_PORT=${SMTP_PORT} diff --git a/next.config.ts b/next.config.ts index a78550f..b276f91 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,6 +3,8 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", images: { + deviceSizes: [640, 750, 828, 1080, 1200], + imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], localPatterns: [ { pathname: "/images/**",