Implementation patterns and configuration for Docker containerization.
For quick start and basic commands, see README.docker.md. For technical reference, see DOCKER_REFERENCE.md.
The bin/dc script simplifies Docker Compose commands with automatic file discovery and environment loading.
./bin/dc [docker-compose-options] [command]Features:
- Mode selection:
MDT_DOCKER_MODEenvironment variable (default:prod)dev→ Includesdocker-compose.dev.ymlprod→ Includesdocker-compose.prod.yml
- Auto-discovery: Automatically includes
docker-compose.{mode}.*.ymlfiles - Custom projects: Supports
MDT_DOCKER_PROJECTS_YMLfor additional compose files - Simply override: Supports
docker-compose.override.ymlas an additional compose files - Environment loading: Loads
.envand.env.localfiles
Sample file volume mapping: docker-compose.override.sample.yml
# Start in dev mode
MDT_DOCKER_MODE=dev ./bin/dc up
# Start in prod mode (default)
./bin/dc up -d
# Add custom project mounts
MDT_DOCKER_PROJECTS_YML=docker-compose.my-projects.yml ./bin/dc up
# Pass any docker-compose option
./bin/dc logs -f backend
./bin/dc exec backend sh
./bin/dc psFor advanced use cases, you can use docker-compose directly:
# Development
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
# Production
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# Custom compose files
docker-compose -f docker-compose.yml -f docker-compose.projects.yml up -dMount your entire workspace directory:
# docker-compose.dev.yml or docker-compose.prod.yml
services:
backend:
volumes:
- ~/projects:/projects
mcp:
volumes:
- ~/projects:/projectsMount specific projects:
services:
backend:
volumes:
- ~/work/project-a:/projects/project-a
- ~/personal/project-b:/projects/project-b
- /data/project-c:/projects/project-c
mcp:
volumes:
- ~/work/project-a:/projects/project-a
- ~/personal/project-b:/projects/project-b
- /data/project-c:/projects/project-cUse the provided sample for local customization:
# Copy and customize
cp docker-compose.override.sample.yml docker-compose.override.yml
# Edit with your project pathsThe override file is automatically loaded by ./bin/dc. This is the standard Docker Compose pattern for local customizations.
# docker-compose.override.yml
x-shared-volumes: &project-volumes
volumes:
- ~/my-project:/projects/my-project
services:
backend:
<<: *project-volumes
mcp:
<<: *project-volumesFor named override files, use YAML anchors:
# docker-compose.projects.yml
x-shared-volumes: &project-volumes
volumes:
- ./debug-tasks:/projects/demo-project
- ./:/projects/markdown-ticket
services:
backend:
<<: *project-volumes
mcp:
<<: *project-volumesUse custom project files:
./bin/dc -f docker-compose.projects.yml up -d --force-recreateThe backend and MCP containers use a shared configuration system for project discovery.
/app/ # Application code (excluded from discovery)
/projects/ # Project mount point
/app/config # Docker configuration directory (persisted in volume)
Backend and MCP containers have these predefined:
environment:
- CONFIG_DIR=/app/config
- CONFIG_DISCOVER_PATH=/projectsView and modify configuration from within containers:
# View current configuration
./bin/dc exec backend node /app/shared/dist/tools/config-cli.js show
# Set discovery paths
./bin/dc exec backend node /app/shared/dist/tools/config-cli.js set discovery.searchPaths "/projects"
# Get specific value
./bin/dc exec backend node /app/shared/dist/tools/config-cli.js get discovery.searchPathsConfiguration persists in the docker-config volume at /app/config.
Demo mode includes pre-configured projects for testing and demonstration.
# Start with demo projects
./bin/dc -f docker-compose.demo.yml up
# Or combine with other compose files
docker-compose -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.demo.yml upDemo projects are mounted from ./demo-projects/ and provide sample tickets for testing the UI and MCP tools.
| Service | Container Port | Host Port | Purpose |
|---|---|---|---|
| Frontend (dev) | 5173 | 5174 | Vite dev server with HMR |
| Frontend (prod) | 80 | 5174 | Nginx static server |
| Backend | 3001 | (none) | Express.js API + SSE |
| MCP | 3002 | 3012 | HTTP transport for LLM |
Note: Backend is internal only, accessible via frontend proxy at /api/*.
Host (localhost:5174, :3012)
↓
Frontend Container
└── /api/* → Backend:3001 (proxy, includes SSE)
Backend Container
├── SSE → Frontend (real-time ticket updates)
└── Mounted volumes (/projects)
MCP Container
├── HTTP transport → Host:3012 (LLM clients)
└── Mounted volumes (/projects) [same as backend]
# Check what's using the port
lsof -i :5174 # Frontend
lsof -i :3012 # MCP
# Change ports in docker-compose files if needed# Verify polling is enabled
./bin/dc exec backend printenv | grep CHOKIDAR
# Check volume mounts
./bin/dc exec backend ls -la /projects
# Restart backend
./bin/dc restart backend# Check config volume
./bin/dc exec backend ls -la /app/config
# View current config
./bin/dc exec backend node /app/shared/dist/tools/config-cli.js show# Test health endpoint
curl http://localhost:3012/health
# Check MCP container
./bin/dc ps mcp
./bin/dc logs -f mcp
# Verify HTTP transport enabled
./bin/dc exec mcp printenv | grep MCP_HTTP# Check all containers
./bin/dc ps
# Test frontend
curl http://localhost:5174/
# Test backend (via frontend proxy)
curl http://localhost:5174/api/projects
# Test MCP
curl http://localhost:3012/healthFor production deployments, enable optional security features. See DOCKER_REFERENCE.md - Security Configuration for details.
environment:
# Origin validation
- MCP_SECURITY_ORIGIN_VALIDATION=true
- MCP_ALLOWED_ORIGINS=https://yourdomain.com
# Rate limiting
- MCP_SECURITY_RATE_LIMITING=true
- MCP_RATE_LIMIT_MAX=100
# Authentication
- MCP_SECURITY_AUTH=true
- MCP_AUTH_TOKEN=${MCP_AUTH_TOKEN}- README.docker.md - Quick start guide
- DOCKER_REFERENCE.md - Technical reference, troubleshooting
- MDT-055 - Docker Architecture CR
- MDT-073 - Configuration Management CR