-
Notifications
You must be signed in to change notification settings - Fork 2.6k
docs(core): add Docker development guidance #33848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| Name | Link |
|---|---|
| 🔨 Latest commit | 1298cc2 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This isn't a correct workaround. Without the NX daemon, you are stuck with services that doesn't reload after changes. You need to manually stop the container and start it again. |
|
Good point - you're right that disabling the daemon loses the automatic file watching. For hot reload without the daemon, the app's bundler (webpack/vite) needs to poll for changes instead: // webpack.config.js
devServer: {
watchOptions: {
poll: 1000,
ignored: /node_modules/
}
}I can add a section covering this trade-off and the polling workaround. Would that address your concern? |
|
I am not on my laptop right now but I think that will not work with projects that runs NestJs applications with the node executor (which is our problem) |
31fe601 to
c9efeb9
Compare
|
I updated the wording a bit, and while it does not provide specific guidance on enabling daemon in containers, it at least clarifies why it is automatically disabled in CI and Docker, with the points that @kazukinakai provided. We can look into a guide for Docker + Daemon in a follow-up. This at least provides users with some information that are currently missing. |
|
View your CI Pipeline Execution ↗ for commit 3ed270c
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud has identified a possible root cause for your failed CI:
Our format check detected a Prettier violation in inputs.mdoc, but this file wasn't modified in this PR. This appears to be a pre-existing formatting issue in the codebase that's now blocking CI. We should fix the formatting in inputs.mdoc separately to unblock this PR.
No code changes were suggested for this issue.
If the issue was transient, you can trigger a rerun by pushing an empty commit:
git commit --allow-empty -m "chore: trigger rerun"
git push
🎓 Learn more about Self-Healing CI on nx.dev
Add comprehensive section explaining: - Why the daemon often fails in Docker containers - Recommended approach: disable daemon with NX_DAEMON=false - Example docker-compose setup for local development - CI/CD best practices for stateless builds This addresses common pain points reported in issues nrwl#29384, nrwl#14126, nrwl#30098, and nrwl#8288.
c9efeb9 to
3ed270c
Compare
|
I merged the content since it provide more information for anyone wondering about Docker + Daemon. As I said earlier, we should have a separate guide for using Dev Containers with Daemon, as the CI/production use case without file-watching is fine without daemon, but local development is not. |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Summary
Adds comprehensive Docker development guidance to the Nx Daemon documentation.
Related to #33263, #30359, #14126
What's included
This PR expands the existing Nx Daemon docs with a new "Running Nx in Docker" section that covers:
NX_DAEMON=falseContext
Several issues have been opened around daemon behavior in containers, but the existing docs only briefly mention socket location customization. Users are left wondering:
Issue #33263 specifically describes daemon crashes when running nx between Docker and non-docker environments - this PR documents the recommended workaround (
NX_DAEMON=false) and explains why.Preview
The new section appears under the existing "Customizing the socket location" heading and includes:
Open to feedback on structure or placement.