fix: Chrome launch on Coolify and add dependencies
This commit is contained in:
+5
-2
@@ -26,9 +26,12 @@ WORKDIR /app
|
|||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
postgresql-client \
|
postgresql-client \
|
||||||
chromium \
|
chromium \
|
||||||
|
nss \
|
||||||
freetype \
|
freetype \
|
||||||
fontconfig \
|
harfbuzz \
|
||||||
ttf-freefont
|
ca-certificates \
|
||||||
|
ttf-freefont \
|
||||||
|
fontconfig
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[phases.setup]
|
||||||
|
nixPkgs = ["...", "chromium", "nss", "freetype", "harfbuzz"]
|
||||||
|
|
||||||
|
[variables]
|
||||||
|
CHROME_PATH = "/usr/bin/chromium"
|
||||||
@@ -128,9 +128,12 @@ export async function GET(request: NextRequest) {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Lighthouse hatası:', error)
|
console.error('Lighthouse hatası:', error)
|
||||||
return NextResponse.json(
|
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 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 }
|
{ status: 500 }
|
||||||
)
|
)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user