Skip to content

Conversation

@comxd
Copy link
Contributor

@comxd comxd commented Dec 5, 2025

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

@ijjk ijjk added the examples Issue was opened via the examples template. label Dec 5, 2025
@ijjk
Copy link
Member

ijjk commented Dec 5, 2025

Allow CI Workflow Run

  • approve CI run for commit: be8718b

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

dxoo added 3 commits December 5, 2025 02:59
…iles

Without NODE_ENV=production, React DevTools may appear in production builds.
This aligns with-docker-compose with the with-docker example.
Some native Node.js modules require libc6-compat on Alpine Linux.
This aligns with-docker-compose with the with-docker example.

See: https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine
…iles

Replace legacy `ENV VAR value` with `ENV VAR=value` for consistency
with Dockerfile best practices and the with-docker example.
@comxd comxd force-pushed the fix/docker-compose-example-alignment branch from 3eef416 to be8718b Compare December 5, 2025 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Issue was opened via the examples template.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants