DCC Docker Container Control
Use DCC as a fast manual alternative when a traditional CI pipeline is unavailable or too slow.
Fast path
When the user says:
dcc deploy website_app
run this on the known Docker server:
sudo /opt/docker-container-control deploy website_app
Do the work immediately. The controller finds the app under /opt, fast-forward pulls its latest Git commit, pulls images, builds, starts/restarts the Compose deployment, waits for it to become running/healthy, and prints final status.
Docker server
Resolve the server from the request, current thread, or authoritative environment documentation.
If the Docker server is unknown or ambiguous, ask which Docker server to use before proceeding. Never guess.
Use the configured SSH helper. Run remote deployment commands with a bounded timeout long enough for builds to finish. If the local SSH process is interrupted, verify on the remote server whether the deployment command is still running.
Install the controller when needed
The bundled controller is docker-container-control at the skill root. Legacy installations may place it at scripts/docker-container-control.
Check the remote server:
test -x /opt/docker-container-control
If missing:
- Locate the bundled controller.
- Validate it locally with
python3 -m py_compile <controller>. - Copy it to a temporary path on the Docker server.
- Install it as root-owned mode
755at/opt/docker-container-control. - Verify with
sudo /opt/docker-container-control list. - Continue the user's requested DCC action without making them repeat it.
If an existing remote controller differs from the bundled version, do not silently overwrite it. Report the difference and ask before replacing it.
Commands
dcc deploy <app>— get the latest Git commit, pull images, build, deploy, restart, wait for health, and show status.dcc dry-run <app>— show the Git and Compose deployment plan without changing containers.dcc list— list detected deployments and usable app names.dcc status <app>— show Compose status.dcc restart <app>— restart the existing Compose deployment and verify health.dcc recreate <app>— rebuild and force-recreate the Compose deployment, then verify health.
Map them directly to:
sudo /opt/docker-container-control <action> [app]
Deployment names can be the app folder name, Compose project name, or running container name. Use exact names. If no deployment matches or more than one matches, show the detected names and ask the user to choose.
Deployment behavior
For a Git checkout, deploy:
- Refuses to run when tracked files have uncommitted changes.
- Runs
git fetch --prune origin. - Runs
git pull --ff-only. - Runs Compose image pull with failures tolerated.
- Runs
docker compose up -d --build. - Waits up to 120 seconds for discovered containers to be running and healthy.
- Prints final Compose status.
A non-Git app skips the Git step and still pulls/builds/starts the Compose deployment.
Reporting
Return the important command output and final Compose status. State success only when the command exits successfully and the deployment reaches running/healthy state.
Do not expand DCC into unrelated operations such as Docker prune, Compose down, Git reset, force-pull, or branch changes.
