Skip to content

Add CNCjs deployment configuration for NU31 infra - #1

Merged
VovaStelmashchuk merged 3 commits into
mainfrom
claude/docker-cncjs-deploy-vqhvjw
Aug 31, 2026
Merged

VovaStelmashchuk merged 3 commits into
mainfrom
claude/docker-cncjs-deploy-vqhvjw

Conversation

@VovaStelmashchuk

Copy link
Copy Markdown
Member

Summary

This PR adds complete deployment infrastructure for CNCjs, a web interface for CNC controllers, to the NU31 Hackerspace Docker Swarm infrastructure. The setup follows the established deployment pattern used by other services in the infra repository.

Key Changes

  • docker-stack.yml: Docker Swarm stack configuration that deploys CNCjs v1.11.3 with:

    • Persistent volume for configuration storage (/var/lib/cncjs/.cncrc)
    • Integration with the existing infra_reverse-proxy network for Caddy routing
    • Stop-first update strategy to prevent conflicts over shared state and serial ports
    • Optional serial device binding for direct machine control (commented out by default)
    • Memory limit of 512MB
  • .github/workflows/deploy.yml: GitHub Actions workflow that:

    • Validates the stack file on pull requests
    • Deploys to the swarm on pushes to main or manual trigger
    • Uses SSH-based deployment with configurable host and user variables
    • Requires ROOT_SSH_PRIVATE_KEY secret for authentication
  • README.md: Comprehensive documentation covering:

    • Project overview and deployment model
    • Runtime configuration details and image versioning strategy
    • Infrastructure dependencies (infra, Caddy, reverse-proxy network)
    • Step-by-step deployment instructions
    • Guidance on connecting physical CNC controllers via serial ports
    • Implementation notes on state management and update strategy
  • .gitignore: Excludes environment files from version control

Notable Implementation Details

  • Pinned image version: The CNCjs image tag is hardcoded in the stack file to ensure reproducible deployments and make upgrades reviewable
  • State management: CNCjs stores all configuration in a single .cncrc file mounted on a persistent volume, avoiding the need for external databases
  • Network isolation: The service only exposes itself to Caddy over the overlay network, with no direct port publication
  • Serial port handling: Documented two approaches for connecting to physical machines—either running standalone on the shop floor or joining the swarm as a labeled node

https://claude.ai/code/session_01Gh6tURnZZGAyos78ZtNuze

claude added 3 commits August 31, 2026 07:37
Deploys cncjs to the nu31 infra swarm the same way gancio-deploy and
matterbridge-deploy do: one stack file, one workflow, deployment over ssh,
no local image build because cncjs publishes its own image to Docker Hub.

The image tag is hardcoded as cncjs/cncjs:v1.11.3 rather than latest, so a
redeploy of an unchanged stack file cannot silently change the running
version and an upgrade is a reviewable one line change.

cncjs keeps all state in .cncrc. $HOME in the image is /root, which holds
the node runtime and cannot be a volume, so the config file is moved onto
the cncjs-data volume via --config.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh6tURnZZGAyos78ZtNuze
Drop the Files, Runtime details, Infra dependencies and step by step deploy
sections from the README, and the two paragraphs explaining how upstream
tags the image. Strip the explanatory comments from docker-stack.yml, the
commented out serial block stays because the README points at it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh6tURnZZGAyos78ZtNuze
Leaves the README with the intro and the notes. Removes the commented out
serial block from docker-stack.yml and the header comment from the deploy
workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh6tURnZZGAyos78ZtNuze
@VovaStelmashchuk
VovaStelmashchuk merged commit efa87f7 into main Aug 31, 2026
2 checks passed
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.

2 participants