Skip to content

Conversation

@ckdarby
Copy link

@ckdarby ckdarby commented Mar 21, 2025

  • Node arg
  • Add multi-stage docker
    • Possible docker npm cache support
    • Include/exclude npm dev dependencies based on NODE_ENV
    • Split Dev/Prod stage to add profiler/breakpoint port expose in future. It's not what we'd want in prod image.
  • Dock-compose now specifies the target to allow picking what to run (default to dev)

For production, NODE_ENV should be set before docker-compose or via source environment via other ways

export NODE_ENV=production && docker compose up --build -d

Comment on lines +3 to +4
ARG NODE_VERSION=18
ARG NODE_ENV=development
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you mentioned, you're not a docker person, I will note these are defaults and can be overridden. Thus why when NODE_EVN is production on your production server it'll switch to that.

I assumed that is how production works given the code has a section banking on NODE_ENV via env for URL to be either d2jam or localhost.

build:
context: .
dockerfile: Dockerfile
target: ${NODE_ENV:-dev}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is default behavior. Use NODE_ENV if it is defined, else use dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant