Metadata-Version: 2.4
Name: fastpluggy-docker
Version: 0.2.58
Summary: Docker management plugin for FastPluggy (containers, services, Swarm)
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: FastPluggy<1,>=0.14.0
Requires-Dist: docker<8,>=6.1.3
Provides-Extra: e2e
Requires-Dist: fastpluggy-cli; extra == "e2e"
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: httpx>=0.27; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Dynamic: license-file

# fastpluggy-docker

![Docker](https://img.shields.io/badge/FastPluggy-Docker-blue)
[![Release](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/-/badges/release.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/-/releases)
[![Pipeline Status](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/badges/main/pipeline.svg?key_text=CI)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/-/pipelines?ignore_skipped=true)
[![Coverage](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/badges/main/coverage.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/docker_plugin/-/pipelines)

Docker management plugin for FastPluggy — containers, services, and Swarm orchestration.

## Install

```bash
pip install -e .
```

## Usage

Register the plugin in your FastPluggy configuration. Once loaded it exposes:

- Swarm overview dashboard (nodes, services, stacks)
- Container list with status and resource stats
- Service scaling and log viewing
- Compose stack detection and management
- Stack deploy / remove via the UI
- Pagination on all list views (`?page=1&page_size=25`)
- Confirmation dialogs for destructive operations (node drain/demote, service scale, stack removal)
- E2E test coverage with Playwright

## Safety

Destructive operations require explicit confirmation:

- **Node operations** — Drain and Demote actions show a Tabler modal requiring user confirmation before execution. Promote, Set Active, and Pause use browser `confirm()` dialogs.
- **Service scaling** — A confirmation modal displays the target replica count before scaling (scaling to 0 or very high numbers can disrupt services).
- **Compose operations** — "Stop all" on a compose stack prompts for confirmation before stopping all containers in the project.
- **Watchtower updates** — Container update actions via Watchtower require confirmation.
- **Stack removal** — Removing a stack shows a confirmation page before deletion.

All state-changing node operations use POST endpoints (not GET) to prevent accidental triggers by bots or browser prefetchers.

## Configuration

All settings are exposed via `DockerSwarmSettings` (environment variables or `.env`):

| Setting | Default | Description |
|---------|---------|-------------|
| `docker_host` | `unix:///var/run/docker.sock` | Docker daemon socket or TCP address |
| `docker_tls_verify` | `false` | Enable TLS verification |
| `docker_cert_path` | — | Path to TLS certificates |

