From 46e88d3782eb8bd67bfd3e1c6383dcfd7e870e22 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Thu, 31 Oct 2024 00:24:28 +1100 Subject: [PATCH] Explicitly specify NODE_ENV --- app/Dockerfile | 5 ++++- app/package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 90066209..2f091a44 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -27,10 +27,13 @@ COPY --from=builder /project/app/.next/static ./.next/static RUN rm -rf ./public ./private COPY --from=builder /project/app/public ./public +ENV NODE_ENV=production + EXPOSE 3000 ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + # server.js is created by next build from the standalone output # https://nextjs.org/docs/pages/api-reference/next-config-js/output -ENV HOSTNAME="0.0.0.0" CMD ["node", "server.js"] \ No newline at end of file diff --git a/app/package.json b/app/package.json index 216d13a8..5983aa04 100644 --- a/app/package.json +++ b/app/package.json @@ -21,7 +21,7 @@ "lint": "cross-env next lint", "payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload", "start": "cross-env next start", - "start-server": "cross-env HOSTNAME=0.0.0.0 PORT=3000 node .next/standalone/server.js", + "start-server": "cross-env NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 node .next/standalone/server.js", "test": "jest" }, "dependencies": {