Skip to content

Commit

Permalink
Don't hardcode PORT to 3000 (#6)
Browse files Browse the repository at this point in the history
Default to 3000, but accept injected PORT from environment
  • Loading branch information
elprans authored Oct 7, 2024
1 parent 7aac8df commit 839dd56
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT=3000

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD HOSTNAME="0.0.0.0" node server.js
CMD /usr/bin/env HOSTNAME="0.0.0.0" PORT="${PORT:-3000}" node server.js

0 comments on commit 839dd56

Please sign in to comment.