Skip to content

Commit

Permalink
Merge pull request #215 from mobeigi/explicitly-specify-node-env
Browse files Browse the repository at this point in the history
Explicitly specify NODE_ENV
  • Loading branch information
mobeigi authored Oct 30, 2024
2 parents f5f620a + 46e88d3 commit a5b7095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit a5b7095

Please sign in to comment.