From 593113e88a9e996ea95779f83fffcfe6299f161f Mon Sep 17 00:00:00 2001 From: ralksta Date: Sun, 8 Mar 2026 20:53:45 +0100 Subject: [PATCH] fix: make about.md optional and copy content folder in Dockerfile --- Dockerfile | 1 + app/about/page.tsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0e71c25..5c03609 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,7 @@ RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public +COPY --from=builder /app/content ./content COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static diff --git a/app/about/page.tsx b/app/about/page.tsx index 888af24..fb69573 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -21,7 +21,11 @@ interface AboutFrontmatter { } function getAboutContent() { - const raw = readFileSync(join(process.cwd(), 'content', 'about.md'), 'utf-8'); + const filePath = join(process.cwd(), 'content', 'about.md'); + if (!require('fs').existsSync(filePath)) { + return { meta: {} as AboutFrontmatter, body: '' }; + } + const raw = readFileSync(filePath, 'utf-8'); const { data, content } = matter(raw); return { meta: data as AboutFrontmatter, body: content.trim() }; }