From 5a3fcba130ac049890ba61485b3f804484c18d20 Mon Sep 17 00:00:00 2001 From: Marco Pedone Date: Thu, 7 Aug 2025 16:02:55 +0200 Subject: [PATCH] fix: update Dockerfile to use npm ci --production and enhance panel API error handling --- apps/infoalloggi/Dockerfile | 2 +- apps/infoalloggi/src/pages/api/panel.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/infoalloggi/Dockerfile b/apps/infoalloggi/Dockerfile index e014ceb..191516d 100644 --- a/apps/infoalloggi/Dockerfile +++ b/apps/infoalloggi/Dockerfile @@ -6,7 +6,7 @@ FROM base AS deps RUN apk add --no-cache libc6-compat openssl WORKDIR /app COPY package*.json package-lock.json* ./ -RUN npm ci +RUN npm ci --production # Builder stage # This stage is used to build the application diff --git a/apps/infoalloggi/src/pages/api/panel.ts b/apps/infoalloggi/src/pages/api/panel.ts index 618b7a7..b767958 100644 --- a/apps/infoalloggi/src/pages/api/panel.ts +++ b/apps/infoalloggi/src/pages/api/panel.ts @@ -4,6 +4,9 @@ import { env } from "~/env.mjs"; import { appRouter } from "~/server/api/root"; export default async function handler(_: NextApiRequest, res: NextApiResponse) { + if (env.NODE_ENV !== "development") { + return res.status(404).send("Not Found"); + } if (!env.NEXT_PUBLIC_BASE_URL.includes("localhost")) { return res.status(404).send("Not Found"); }