Add `nx add docker` to write the container files
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, node.js, python, vite
- Domain
- build-system, devops
Research direction
Start with the Docker section in docs/deployment/README.md and the file-writing behavior of nx add vercel from issue #671. Trace the CLI entry points for nx add and nexy add, then check how generated files are tested. Done means the Docker files match the documented commands, preserve developer-owned files, are idempotent, and the docs are listed in docs/README.md and llms.txt.
Written by the indexing model from the issue text.
Description
Problem
The deployment docs show a working multi-stage Dockerfile, but a developer has to copy it into each project and keep it in sync with the documented build and start commands. A hand-copied file can expose Node in the runtime image, omit .dockerignore, or use the wrong command.
Proposed solution
Add nx add docker (also available as nexy add docker) that writes the container files for an existing Nexy project:
- Write a
Dockerfilematchingdocs/deployment/README.md: a Node build stage withuv sync --frozenanduv run nx build, and a Python runtime stage that serves withnx start --host 0.0.0.0 --port 8000. - Write a
.dockerignorethat keeps local virtualenvs, caches, git data and__nexy__/out of the build context. - Keep the action secret out of the image and document
NEXY_ACTION_SECRETas a runtime environment variable. - Print every file changed, skip files that already have the wanted content, and leave the project unchanged on a second run, like
nx add vercel.
Acceptance criteria:
docker buildfollowed bydocker run -p 8000:8000serves the built app.- The runtime stage needs Python only; Node and Vite are not present in the final image.
- Running the command twice produces no further changes and never overwrites a file the developer owns.
- Tests cover the generated bytes, the ignore list, conflict handling and idempotency.
- A docs page explains build, run, environment variables and health checks, and is listed in
docs/README.mdandllms.txt.
Alternative solutions
Keep the Dockerfile only in docs/deployment/README.md. That avoids a new command but leaves copying and drift to every project.
Additional context
The verified source is the Docker section of docs/deployment/README.md. The command should follow the file writing behavior of nx add vercel (issue #671): data describing the generated files, no platform dependency added to the framework core, and no overwrite of a file the developer owns.
Validation
- I have searched existing issues and this is not a duplicate.
- I would be willing to help implement this feature.
- Dominant language
- Python
- Stars
- 11
- Forks
- 6
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 265
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NexyPy/nexy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:cli difficulty:intermediate enhancement
Difficulty 2/5 Half a day Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area:cli area:docs question
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jxxghp/MoviePilot#7699 ·
Maintainers usually reply within 1 day
-
bug TAG: unit tests
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
learningequality/ricecooker#898 ·
-
next
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
j3ko/agent-plugins#80 ·
Maintainers usually reply within 1 day
-
bug:unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Heroic-Games-Launcher/HeroicGamesLauncher#6187 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
BCStudentSoftwareDevTeam/cas#491 ·
Maintainers usually reply within 8 days