Skip to content

Compose library stack actions - #6

Draft
imperfektlabs wants to merge 4 commits into
RGJorge:mainfrom
imperfektlabs:compose-library-stack-actions
Draft

imperfektlabs wants to merge 4 commits into
RGJorge:mainfrom
imperfektlabs:compose-library-stack-actions

Conversation

@imperfektlabs

Copy link
Copy Markdown

Summary

This PR adds a Compose Library so ContainerFlow can discover services defined in Compose files even when nothing is currently running, and start them from the UI.

It expands the app from a runtime-only view into a runtime + Compose inventory view.

What changed

  • scans user-configured stack paths via COMPOSE_SCAN_PATHS
  • discovers Compose files recursively
  • parses services from:
    • compose.yml
    • compose.yaml
    • docker-compose.yml
    • docker-compose.yaml
  • groups related stacks by folder/variant so shared stack families stay together
  • ignores @Recycle paths
  • matches discovered services to live Docker containers when they exist
  • adds a Compose Library overlay in the header
  • shows service states:
    • running
    • stopped
    • not created
    • profiled
  • adds Up and Up Stack actions
  • adds stack Stop and Down actions
  • sanitizes compose action environment so stack-local .env files are respected
  • adds inline action output so compose jobs are visible while they run
  • defers library prefetch so the main dashboard loads first

Why

Most Docker tools only show what is already running. I wanted ContainerFlow to also surface what is defined on disk but currently down, so stacks and services can be launched from one place.

Notes

  • This is configuration-driven and does not assume any repo-specific stack path.
  • Multi-host support is intended later.
  • Compose actions are scoped to stacks that are reachable from the configured scan paths and allowed paths.
  • No local compose files or environment files are included in this PR.

Validation

  • rebased onto current upstream/main
  • branch pushed to my fork
  • compose-library tests were added and passed in local verification

Deployment notes

Set COMPOSE_SCAN_PATHS to the directory or directories where your Compose files live, for example:

COMPOSE_SCAN_PATHS=/path/to/stacks

If ContainerFlow runs inside Docker, mount those paths into the container read-only so the server can scan them.

Group scanned compose files by stack family with optional variants, skip @recycle folders, and defer the library prefetch so the dashboard can load first.

Run docker compose actions with a sanitized environment so ContainerFlow's own stack variables do not leak into target stacks. Return job ids for library actions and show inline action output with auto-scroll and success auto-close.
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