next.js
next.js copied to clipboard
fix(examples): align with-docker-compose Dockerfiles with with-docker example
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=productiontoprod.Dockerfileandprod-without-multistage.Dockerfile- Without this, React DevTools may appear in production builds - Add
libc6-compatto all three Dockerfiles - Required for some native Node.js modules on Alpine Linux - Use modern ENV syntax (
ENV VAR=valueinstead ofENV 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
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