Skip to content

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 ​

bash
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 /output

Key flags:

FlagPurpose
--rmRemove the container after it exits
-e ANTHROPIC_API_KEYPass the LLM API key from the host environment
-v workspace:/workspaceMount the SWAO workspace into the container
-v output:/outputWrite assessment output to a host directory

2. Environment variables ​

VariableRequiredDescription
ANTHROPIC_API_KEYYes (unless using --skip-llm)Anthropic API key for Claude
SWAO_LLM_PROVIDERNoOverride default LLM provider (anthropic, ollama, openai)
SWAO_LOG_LEVELNoLog verbosity: debug, info, warn, error
SWAO_WORKSPACENoDefault workspace path inside the container
SWAO_CONFIG_DIRSet by the imageOne 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_IDRecommended with a persisted vaultAny 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>NoA credential from the environment, for example SWAO_CREDENTIAL_ANTHROPIC_API_KEY; used even when the vault cannot be read
SWAO_MCP_TOKENYes for a published MCP portBearer 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:

bash
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 /workspace

If 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:

yaml
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 ​

bash
# 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-check

4. Docker Compose example ​

For persistent named volumes and easier multi-run usage:

yaml
# 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:

bash
docker compose up -d swao-mcp
docker compose run --rm swao

5. Populating the workspace volume ​

To seed the named workspace volume from a local directory:

bash
# 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):

yaml
volumes:
  - /path/to/my-workspace:/workspace

6. 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.

bash
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-stub was 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:

bash
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 /workspace

Current release tags are listed at https://github.com/Accenture/SWAO/releases.