From 9f22f4c198b617c0e1a05803e6694e5001eda5b8 Mon Sep 17 00:00:00 2001 From: Neshura Date: Fri, 9 Dec 2022 22:36:42 +0100 Subject: [PATCH 1/2] Updated pages.json references --- pages/games.tsx | 2 +- pages/services.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/games.tsx b/pages/games.tsx index 8193f41..17ce412 100644 --- a/pages/games.tsx +++ b/pages/games.tsx @@ -55,7 +55,7 @@ function Servers(props: LinkList) { } export async function getServerSideProps() { - const filePath = path.join(process.cwd(), '/confs/pages.json') + const filePath = path.join(process.cwd(), '/public/pages.json') const jsonData = await fsPromises.readFile(filePath) const list = JSON.parse(jsonData.toString()) diff --git a/pages/services.tsx b/pages/services.tsx index 2f2d63c..2ce661c 100644 --- a/pages/services.tsx +++ b/pages/services.tsx @@ -40,9 +40,9 @@ function Services(props: LinkList) { ) } -// Gets a List of all services specified in /confs/pages.json +// Gets a List of all services specified in /public/pages.json export async function getServerSideProps() { - const filePath = path.join(process.cwd(), './confs/pages.json') + const filePath = path.join(process.cwd(), '/public/pages.json') // TODO: look into asyncing this API call const jsonData = await fsPromises.readFile(filePath) const list = JSON.parse(jsonData.toString()) From 39afc6cdd6c9ecdaead0d4d5363e595bd095f795 Mon Sep 17 00:00:00 2001 From: Neshura Date: Fri, 9 Dec 2022 23:28:15 +0100 Subject: [PATCH 2/2] removed nextjs user to allow usage of docker.sock --- Dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index f12604d..af0ce88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,18 +30,13 @@ WORKDIR /usr/src/app ENV NODE_ENV production -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs - COPY --from=builder /app/public ./public COPY --from=builder /app/node_modules ./node_modules # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ -COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static - -USER nextjs +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static # expose port 3000 ENV PORT 3000