Docker Deployment
Run SWAO inside a Docker container for reproducible assessments, air-gapped environments, or team-shared infrastructure. This runbook covers the basic docker run invocation, a Docker Compose setup with named volumes, and offline operation using --skip-llm.
Prerequisites
- Docker Engine 24.x or later (or Docker Desktop 4.x)
- Docker Compose v2 (if using the Compose example)
- A workspace directory on the host machine
1. Basic docker run
docker run --rm \
-e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" \
-v "$(pwd)/workspace:/workspace" \
-v "$(pwd)/output:/output" \
ghcr.io/accenture/swao:latest \
assess --app sovereign-health --workspace /workspace --output /outputKey flags:
| Flag | Purpose |
|---|---|
--rm | Remove the container after it exits |
-e ANTHROPIC_API_KEY | Pass the LLM API key from the host environment |
-v workspace:/workspace | Mount the SWAO workspace into the container |
-v output:/output | Write assessment output to a host directory |
2. Environment variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | Yes (unless using --skip-llm) | Anthropic API key for Claude |
SWAO_LLM_PROVIDER | No | Override default LLM provider (anthropic, ollama, openai) |
SWAO_LOG_LEVEL | No | Log verbosity: debug, info, warn, error |
SWAO_WORKSPACE | No | Default workspace path inside the container |
SWAO_CONFIG_DIR | Set by the image | One directory for the licence state, the licence file and the credential vault. Every SWAO image sets it to /swao-home and declares that volume |
SWAO_VAULT_ID | Recommended with a persisted vault | Any stable, non-secret id (for example the deployment name). It replaces user and host name in the vault key, so the vault stays readable when the container host name changes. A vault written without it cannot be read with it, and the reverse |
SWAO_CREDENTIAL_<NAME> | No | A credential from the environment, for example SWAO_CREDENTIAL_ANTHROPIC_API_KEY; used even when the vault cannot be read |
SWAO_MCP_TOKEN | Yes for a published MCP port | Bearer token of the MCP HTTP server, see section 4 |
Persisting the licence and the vault
Without a volume on /swao-home, every container start is a first run: the licence sees a new machine fingerprint and the credential vault is empty. Mount a persistent volume there and set a fixed SWAO_VAULT_ID:
docker run --rm \
-e SWAO_VAULT_ID=swao-team \
-v swao_home:/swao-home \
-v "$(pwd)/workspace:/workspace" \
ghcr.io/accenture/swao:latest \
assess --app sovereign-health --workspace /workspaceIf the vault cannot be decrypted (another machine, user or SWAO_VAULT_ID, or a damaged file), SWAO still reads credentials from SWAO_CREDENTIAL_* variables and refuses only to write to the vault; the message names the causes. To start a new vault, move the old file away and store the credentials again.
Outside a container, SWAO_CONFIG_DIR and SWAO_VAULT_ID are optional; without them every file keeps its usual location.
Kubernetes (Helm)
The example chart in examples/helm/swao/ runs SWAO as a Job with the same layout. The relevant values:
home:
pvcName: swao-home # existing PersistentVolumeClaim, mounted on /swao-home; without it every pod is a first run
vaultId: swao-prod # becomes SWAO_VAULT_ID
credentialsSecretName: swao-credentials # existing Secret whose keys are SWAO_CREDENTIAL_* names (envFrom)Prefer credentialsSecretName over the inline credentials: map, so no credential value sits in the values file.
3. Run the health check before assess
# Check all probes before running a full assessment
docker run --rm \
-e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" \
-v swao_home:/swao-home \
ghcr.io/accenture/swao:latest \
health-check4. Docker Compose example
For persistent named volumes and easier multi-run usage:
# docker-compose.yml
version: "3.9"
services:
swao:
image: ghcr.io/accenture/swao:latest
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- SWAO_LOG_LEVEL=info
- SWAO_VAULT_ID=swao-compose
volumes:
- workspace:/workspace
- output:/output
- swao_home:/swao-home
command: assess --app sovereign-health --workspace /workspace --output /output
swao-mcp:
image: ghcr.io/accenture/swao:latest
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- SWAO_VAULT_ID=swao-compose
- SWAO_MCP_TOKEN=${SWAO_MCP_TOKEN} # mandatory with --allow-remote
volumes:
- swao_home:/swao-home
ports:
- "3737:3737"
command: mcp --http --host 0.0.0.0 --port 3737 --allow-remote
restart: unless-stopped
volumes:
workspace:
output:
swao_home:A published MCP port is a remote bind: inside the container the server must listen on all interfaces, which needs --allow-remote, and with --allow-remote it refuses to start without SWAO_MCP_TOKEN. Every client sends Authorization: Bearer <token>. The server has no TLS of its own: keep it on a trusted network or behind a TLS proxy. See MCP integration.
Start the MCP server in the background and run a one-shot assessment:
docker compose up -d swao-mcp
docker compose run --rm swao5. Populating the workspace volume
To seed the named workspace volume from a local directory:
# Copy workspace files into the named volume
docker run --rm \
-v "$(pwd)/my-workspace:/src" \
-v "swao_workspace:/workspace" \
alpine sh -c "cp -r /src/. /workspace/"Alternatively, bind-mount a host directory directly (replace the workspace: volume reference with an absolute host path):
volumes:
- /path/to/my-workspace:/workspace6. Air-gapped usage with --skip-llm
In environments without internet access, use --skip-llm to run only the static and Playwright analysis passes. No API key is required and no LLM calls are made.
docker run --rm \
-v "$(pwd)/workspace:/workspace" \
-v "$(pwd)/output:/output" \
ghcr.io/accenture/swao:latest \
assess --app sovereign-health --skip-llm --workspace /workspace --output /output--skip-llm removes the comp (compliance LLM) and blocks (block analysis) passes from the pipeline. All deterministic passes (inventory, SBOM, cryptography, data classification, 7R synthesis, and landing zone) still run and emit signals. Output files are written exactly as in a live run, making this mode useful for pipeline testing and schema validation without incurring API costs.
Note:
--llm-stubwas removed in v0.4.7. If you have scripts referencing it, replace with--skip-llm.
7. Pinning image versions
Avoid using the :latest tag in production pipelines. Pin to a specific release:
docker pull ghcr.io/accenture/swao:0.5.1
docker run --rm \
-e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" \
-v "$(pwd)/workspace:/workspace" \
ghcr.io/accenture/swao:0.5.1 \
assess --app sovereign-health --workspace /workspaceCurrent release tags are listed at https://github.com/Accenture/SWAO/releases.
