Skip to content

Implement Import Wizard to easily migrate Docker Containers to Compose#92

Open
mstrhakr wants to merge 40 commits intodevfrom
feat/composerize
Open

Implement Import Wizard to easily migrate Docker Containers to Compose#92
mstrhakr wants to merge 40 commits intodevfrom
feat/composerize

Conversation

@mstrhakr
Copy link
Copy Markdown
Owner

@mstrhakr mstrhakr commented Apr 13, 2026

This pull request adds a major new feature: an Import Wizard for converting existing Docker Manager containers into Compose stacks, along with backend API endpoints and a new documentation page. It also includes several UI and style improvements to the editor modal. The most important changes are grouped below.


New Feature: Import Wizard

  • Added a new Import Wizard to the Compose Manager, allowing users to convert Docker Manager containers to Compose stacks via a guided 5-stage workflow. This includes backend logic for container discovery, Compose YAML generation, conflict detection, dependency configuration, and file writing/removal. (source/compose.manager/include/Exec.php, README.md, docs/import-wizard.md) (Ff4ba988R77, [1] [2]
  • Added documentation for the Import Wizard, describing its workflow, options, and troubleshooting steps. (docs/import-wizard.md, README.md) [1] [2]

Backend API Endpoints

  • Implemented several new API actions in Exec.php to support the Import Wizard, including: container discovery (getDockerContainersForImport), import preview generation, rich import data for the wizard, Compose YAML validation, and performing the import transfer (with options to stop/remove source containers and start the new stack). (source/compose.manager/include/Exec.php) (Ff4ba988R77)

UI/UX Improvements

  • Updated the editor modal styles to support the new wizard, including improved modal header/footer, close button, and validation styles. (source/compose.manager/sheets/EditorModal.css) [1] [2] [3] [4]

These changes collectively introduce a powerful workflow for migrating existing Docker containers into managed Compose stacks, with a focus on user guidance, validation, and safety.

mstrhakr and others added 9 commits April 13, 2026 12:55
- Implemented CSS styles for the Import Wizard, including a 6-stage stepper, service configuration cards, healthcheck sections, and validation stages.
- Created unit tests for new backend functions related to the Import Wizard, covering duration conversion, port mapping parsing, healthcheck guessing, port conflict detection, and YAML generation for Docker services.
Copilot AI review requested due to automatic review settings April 13, 2026 19:28

This comment was marked as resolved.

The .editor-validation.error rule was removed and several CSS rules
(.settings-panel, .settings-section, .settings-section-title,
.settings-field) had invalid nesting with unrelated rules embedded inside.

Restores the .editor-validation.error rule and fixes all broken
CSS by removing invalid nesting and restoring proper top-level rules.

Co-authored-by: copilot-pull-request-reviewer[bot]
The UI implements a 5-stage flow (generating + validation merged into
"Review & Import"), but docs and backend comments still referenced a
6-stage workflow. Update all references to 5-stage and merge the
docs for stages 5/6 into a single "Review & Import" stage.

Co-authored-by: copilot-pull-request-reviewer[bot]
yamlQuoteValue() was casting all values to string before checking
is_numeric(), which caused integer fields like healthcheck.retries
to be emitted as quoted strings ("3") instead of bare numbers (3).
Docker Compose schema validation expects integers for these fields.

Now checks is_int/is_float first and returns them as bare YAML
scalars. Numeric strings (passed as string type) are still quoted
to prevent YAML misinterpretation.

Co-authored-by: copilot-pull-request-reviewer[bot]
The review screen allowed clicking Import even when validation.valid
was false. Since this flow can stop/remove original containers,
proceeding with invalid compose is risky.

Adds actionDisabled support to wizardFooter and disables the Import
button when the generated compose YAML fails validation.

Co-authored-by: copilot-pull-request-reviewer[bot]
performImportTransfer wrote compose/.env/override files via
file_put_contents() without checking for write failures, then
proceeded to stop/remove source containers regardless. This could
cause data loss if files were not written (permissions, full disk).

Now checks return values and aborts with an error before touching
any containers if any file write fails.

Co-authored-by: copilot-pull-request-reviewer[bot]
The WebUI link in the import wizard container table used
target="_blank" without rel="noopener noreferrer", allowing the
opened page to access window.opener (tabnabbing risk).

Co-authored-by: copilot-pull-request-reviewer[bot]

This comment was marked as resolved.

This comment was marked as resolved.

mstrhakr added 17 commits April 13, 2026 22:24
When both stopContainers and removeContainers are enabled, docker rm -f
already force-stops the container. Running docker stop first is redundant
and doubles shutdown time per container.
Superseded by generateImportData which returns richer per-service metadata
for the 5-stage wizard. No frontend callers exist for this action.
Frontend stores __originalTestType and __originalTestCmd as metadata inside
healthcheck objects for CMD/CMD-SHELL type preservation. These private keys
leaked through to the YAML emitter because they weren't filtered.

1. Backend: skip __-prefixed keys when emitting healthcheck YAML
2. Frontend: strip __original* keys before sending to finalizeImportCompose
…s for improved error handling and metadata generation
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.

Integrate Composerizer or Similar to allow for migrating existing containers to new stack

2 participants