This guide covers Docker and Podman deployment details, including volume mounting, environment variables, and production usage patterns.
For basic setup instructions, see setup.md.
Volume mounting allows you to:
- Edit team markdown files on your host machine
- Persist data across container restarts
- Use Git for version control of team files
- Enable non-developers to edit files via GitHub/GitLab web interface
docker run -p 8000:8000 -v ./data:/app/data team-topologies-vizWhat this does:
-v ./data:/app/datamounts your localdata/directory into the container at/app/data- The container reads team files from your host filesystem
- Changes to files on your host are immediately visible in the running application
- Data persists when you stop/restart the container
docker run -p 8000:8000 -v ./data:/app/data team-topologies-vizUse relative path ./data or absolute path /full/path/to/data.
podman run -p 8000:8000 -v ./data:/app/data:z team-topologies-vizSELinux systems: Add :z flag to relabel the volume for container access. Without this, the container may not have permission to read/write files.
# Use ${PWD} for current directory
podman run -p 8000:8000 -v ${PWD}/data:/app/data team-topologies-viz
# Or use full path
docker run -p 8000:8000 -v C:/Users/username/project/data:/app/data team-topologies-vizImportant:
- Use PowerShell, not Git Bash (Git Bash has path conversion issues)
- Use forward slashes
/in paths, even on Windows - Use
${PWD}instead of./in PowerShell - Omit
:zflag on Windows (SELinux not used)
Git Bash may incorrectly convert paths. If you must use Git Bash:
docker run -p 8000:8000 -v /${PWD}/data:/app/data team-topologies-vizBut PowerShell is the recommended approach on Windows.
Enable read-only mode for demonstrations, workshops, or public-facing deployments where you don't want users to save changes.
docker run -p 8000:8000 -e READ_ONLY_MODE=true team-topologies-vizWhat it does:
- Displays a banner indicating read-only mode
- Blocks all write operations:
- Team position updates (drag-and-drop)
- Snapshot creation
- Allows full visualization interaction (zoom, pan, view switching)
Use cases:
- Public demonstrations
- Training workshops
- Exploratory sessions where changes shouldn't persist
Switch between multiple TT design variants (different design proposals or evolution stages).
docker run -p 8000:8000 -e TT_DESIGN_VARIANT=tt-teams-initial team-topologies-vizWhat it does:
- Changes which
data/subfolder the app reads TT design teams from - Default:
tt-teams(ifTT_DESIGN_VARIANTis not set) - Custom: any folder name you specify (e.g.,
tt-teams-initial,tt-design-2024-q1)
Use cases:
- Comparing different design proposals side-by-side
- Tracking transformation evolution over time
- A/B testing different TT designs
Example variants:
# First-step transformation
docker run -p 8000:8000 -e TT_DESIGN_VARIANT=tt-teams-initial team-topologies-viz
# Mid-stage transformation (default)
docker run -p 8000:8000 team-topologies-viz
# Future proposal
docker run -p 8000:8000 -e TT_DESIGN_VARIANT=tt-design-2024-q2 team-topologies-vizdocker run -p 8000:8000 \
-e READ_ONLY_MODE=true \
-e TT_DESIGN_VARIANT=tt-teams-initial \
-v ./data:/app/data \
team-topologies-vizdocker run -p 8000:8000 -v ./data:/app/data team-topologies-vizRun in background (detached):
docker run -d -p 8000:8000 -v ./data:/app/data team-topologies-viz# List running containers
docker ps
# Stop by container ID
docker stop <container-id>
# Stop all running containers
docker stop $(docker ps -q)# Follow logs in real-time
docker logs -f <container-id>
# Last 100 lines
docker logs --tail 100 <container-id># Remove stopped container
docker rm <container-id>
# Remove all stopped containers
docker container prunedocker restart <container-id>-
Fork or clone the repository
git clone https://github.com/your-org/team-topologies-visualizer.git cd team-topologies-visualizer -
Customize for your organization
- Edit
data/baseline-teams/baseline-team-types.jsonwith your team classifications - Replace example team files in
data/baseline-teams/with your actual teams - Design your TT future state in
data/tt-teams/
- Edit
-
Commit and push to your fork
git add data/ git commit -m "Add our organization's team data" git push origin main -
Deploy with Docker + volume mount
docker build -t team-topologies-viz . docker run -d -p 8000:8000 -v ./data:/app/data team-topologies-viz -
Team members edit files
- Option A: Edit locally and push to Git
- Option B: Edit directly in GitHub/GitLab web interface (no local setup needed)
-
Pull updates and restart
git pull origin main docker restart <container-id>
Best for non-developers:
- Navigate to
data/baseline-teams/ordata/tt-teams/in GitHub/GitLab - Click on a team file (e.g.,
mobile-app-team.md) - Click "Edit" button (pencil icon)
- Edit YAML front matter or Markdown content
- Commit changes directly in the web interface
- Changes are immediately in Git (version controlled, auditable)
- Pull changes on the server and restart container
Advantages:
- No local setup required
- Git version control automatically
- Accessible to non-technical team members
- Audit trail of who changed what
Development:
docker run -p 8000:8000 -v ./data-dev:/app/data team-topologies-vizStaging:
docker run -p 8000:8000 -v ./data-staging:/app/data team-topologies-vizProduction (read-only):
docker run -p 8000:8000 \
-e READ_ONLY_MODE=true \
-v ./data:/app/data \
team-topologies-vizProblem: Container can't read/write files in mounted volume.
Solution (Linux/Mac with SELinux):
# Add :z flag for SELinux relabeling
podman run -p 8000:8000 -v ./data:/app/data:z team-topologies-vizSolution (Windows):
# Ensure Docker Desktop has access to the drive
# Settings → Resources → File Sharing → Add driveProblem: Volume mount doesn't work in Git Bash.
Solution: Use PowerShell instead:
podman run -p 8000:8000 -v ${PWD}/data:/app/data team-topologies-vizProblem: Container starts but exits right away.
Check logs:
docker logs <container-id>Common causes:
- Port 8000 already in use
- Missing dependencies in Dockerfile
- Syntax error in Python code
Problem: Edited team files but changes don't appear in the app.
Solution 1: Hard refresh browser
Ctrl+Shift+R (Windows/Linux)
Cmd+Shift+R (Mac)
Solution 2: Check volume mount is correct
# Verify mount point
docker inspect <container-id> | grep Mounts -A 10Solution 3: Restart container
docker restart <container-id>Problem: docker run fails with "port is already allocated".
Solution: Find and stop process using port 8000
# Linux/Mac
lsof -i :8000
kill <PID>
# Windows PowerShell
netstat -ano | findstr :8000
taskkill /PID <PID> /FOr use a different port:
docker run -p 8080:8000 -v ./data:/app/data team-topologies-vizLimit container resources:
docker run -p 8000:8000 \
--memory="512m" \
--cpus="1.0" \
-v ./data:/app/data \
team-topologies-vizAdd health check to Dockerfile:
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/docs || exit 1Run behind nginx or traefik for HTTPS:
server {
listen 443 ssl;
server_name tt-viz.example.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}# Backup data folder
tar -czf data-backup-$(date +%Y%m%d).tar.gz data/
# Or rely on Git (recommended)
cd data/
git add .
git commit -m "Backup: $(date +%Y-%m-%d)"
git pushFor more complex setups, use Docker Compose:
# docker-compose.yml
version: '3.8'
services:
app:
build: .
ports:
- "8000:8000"
volumes:
- ./data:/app/data
environment:
- READ_ONLY_MODE=false
- TT_DESIGN_VARIANT=tt-teams
restart: unless-stoppedUsage:
# Start
docker-compose up -d
# Stop
docker-compose down
# View logs
docker-compose logs -f
# Rebuild
docker-compose up -d --build- See setup.md for local Python setup
- See usage.md for UI walkthrough
- See example_data.md for example data variants