diff --git a/Dockerfile b/Dockerfile index 3443cf4..dd6a7e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,9 +26,12 @@ WORKDIR /app RUN apk add --no-cache \ postgresql-client \ chromium \ + nss \ freetype \ - fontconfig \ - ttf-freefont + harfbuzz \ + ca-certificates \ + ttf-freefont \ + fontconfig ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 diff --git a/nixpacks.toml b/nixpacks.toml new file mode 100644 index 0000000..9c4bbfd --- /dev/null +++ b/nixpacks.toml @@ -0,0 +1,5 @@ +[phases.setup] +nixPkgs = ["...", "chromium", "nss", "freetype", "harfbuzz"] + +[variables] +CHROME_PATH = "/usr/bin/chromium" diff --git a/src/app/api/insight/route.ts b/src/app/api/insight/route.ts index 42985b6..71ca518 100644 --- a/src/app/api/insight/route.ts +++ b/src/app/api/insight/route.ts @@ -128,9 +128,12 @@ export async function GET(request: NextRequest) { } catch (error: any) { console.error('Lighthouse hatası:', error) return NextResponse.json( - { error: error.message.includes('zaman aşımı') + { + error: error.message.includes('zaman aşımı') ? 'Analiz zaman aşımına uğradı, lütfen tekrar deneyin.' - : 'Analiz sırasında hata oluştu. Sunucuda Chrome yüklü olduğundan emin olun.' }, + : 'Analiz sırasında hata oluştu. Sunucuda Chrome yüklü olduğundan emin olun.', + details: error?.message || String(error) + }, { status: 500 } ) } finally {