next.js icon indicating copy to clipboard operation
next.js copied to clipboard

fix(examples): align with-docker-compose Dockerfiles with with-docker example

Open comxd opened this issue 1 month ago • 1 comments

Summary

This PR aligns the with-docker-compose example Dockerfiles with the with-docker example to ensure consistency and fix a production issue:

  • Add NODE_ENV=production to prod.Dockerfile and prod-without-multistage.Dockerfile - Without this, React DevTools may appear in production builds
  • Add libc6-compat to all three Dockerfiles - Required for some native Node.js modules on Alpine Linux
  • Use modern ENV syntax (ENV VAR=value instead of ENV VAR value) for consistency

Why?

When building with prod.Dockerfile, the resulting image was missing NODE_ENV=production in the runner stage, causing React to run in development mode (React DevTools visible in browser).

The with-docker example already has these configurations correctly set. This PR brings with-docker-compose to parity.

Related

Reference implementation: examples/with-docker/Dockerfile

comxd avatar Dec 05 '25 01:12 comxd

Allow CI Workflow Run

  • [ ] approve CI run for commit: be8718b968be67dfc6379e4802c2f27ec280fc61

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

ijjk avatar Dec 05 '25 01:12 ijjk