From fea6682024e9bb378eb7eba9cf3df8c7c5a60855 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Mon, 18 May 2026 21:34:25 +0300 Subject: [PATCH] feat: switch to standalone output with PocketBase remotePatterns Drops static export (STATIC_EXPORT env var) in favour of standalone for ISR. Images remotePatterns reads PB_HOSTNAME/PB_PORT env vars so Docker internal hostname works without hardcoding. --- next.config.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/next.config.ts b/next.config.ts index da54b25..9def4bf 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,13 +1,21 @@ import type { NextConfig } from 'next'; -/* output: 'export' is opt-in via STATIC_EXPORT=true. - * Set this in CI/deploy — not locally — so the mock API route works - * during development and local builds. */ -const isExport = process.env.STATIC_EXPORT === 'true'; +/* PocketBase origin — used to allowlist remote images. + * PB_HOSTNAME and PB_PORT are server-only env vars; safe to read here. */ +const pbHostname = process.env.PB_HOSTNAME ?? '127.0.0.1'; +const pbPort = parseInt(process.env.PB_PORT ?? '8090', 10); const nextConfig: NextConfig = { - ...(isExport ? { output: 'export' } : {}), - images: { unoptimized: true }, + output: 'standalone', + images: { + remotePatterns: [ + { + protocol: 'http', + hostname: pbHostname, + port: String(pbPort), + }, + ], + }, experimental: { viewTransition: true, },