From 6f2f1c1f6cc84cc6679464f0277ca849a0931cf6 Mon Sep 17 00:00:00 2001 From: Rauno Tegelmann Date: Wed, 24 Jul 2024 11:24:21 +0300 Subject: [PATCH] fix(#144): settings permissions --- Dockerfile | 8 ++++++-- src/utils/getSettings.ts | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 464950b9..9a49a5a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,9 +53,13 @@ RUN adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public COPY --from=builder /app/config ./config -# Set the correct permission for prerender cache +# Set the correct permission for prerender cache and config RUN mkdir .next -RUN chown nextjs:nodejs .next +RUN mkdir .next/cache +RUN chown -R nextjs:nodejs .next +RUN chown -R nextjs:nodejs config +RUN chmod -R 777 .next/cache +RUN chmod -R 777 config # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing diff --git a/src/utils/getSettings.ts b/src/utils/getSettings.ts index 3e142bd7..125eae19 100644 --- a/src/utils/getSettings.ts +++ b/src/utils/getSettings.ts @@ -25,12 +25,10 @@ export default async function getSettings(): Promise { return DEFAULT_SETTINGS } else { - console.error('Error reading settings file:', error) throw new Error('Could not read settings file') } } } catch (error) { - console.error('Failed to handle settings file:', error) throw new Error('Unexpected error handling settings file') } }