Docker & HTTPS Setup
Configure Docker, Traefik, and local HTTPS for Panopticon workspaces.Overview
Panopticon uses Docker for isolated development environments and Traefik as a reverse proxy for local HTTPS. This enables:- Isolated workspaces - Each feature branch runs in its own containers
- Local HTTPS - Trusted certificates for
.localhostor custom domains - Automatic routing - Traefik routes traffic based on container labels
Prerequisites
- Docker Desktop (macOS/Windows) or Docker Engine (Linux)
- Docker Compose v2.x
mkcertfor local certificate generation
Quick Setup
Traefik Configuration
Panopticon manages Traefik configuration in~/.panopticon/traefik/:
Static Configuration
The main Traefik config (~/.panopticon/traefik/traefik.yml):
Dynamic Configuration
Each workspace gets a dynamic config file. Example forfeature-min-123:
Certificate Generation
Using mkcert
For Custom Domains
If using custom domains likemyapp.test:
DNS Configuration
Option 1: .localhost (Recommended)
Modern browsers resolve*.localhost to 127.0.0.1 automatically. No DNS config needed.
Option 2: /etc/hosts
For custom domains, add entries to/etc/hosts:
Option 3: WSL2 Hosts Sync (Windows)
For WSL2, use thewsl2hosts sync method:
/etc/hosts and Windows’ hosts file.
Starting Traefik
Via Dashboard
The dashboard starts Traefik automatically when you runpan up:
Manually
Workspace Container Setup
Docker Compose Template
Network Setup
Create the shared Panopticon network:Troubleshooting
”Connection refused” on HTTPS
-
Check Traefik is running:
-
Check Traefik logs:
-
Verify certificates exist:
“Certificate not trusted” warnings
-
Install mkcert’s CA:
- Restart your browser
Workspace containers not routable
-
Verify containers are on the panopticon network:
-
Check container labels:
- Check Traefik dashboard at http://localhost:8080
Port conflicts
If ports 80/443 are in use:WSL2-specific issues
See Troubleshooting for WSL2-specific networking and performance issues.Best Practices
Resource Management
- Limit concurrent workspaces - Each workspace uses memory
- Use shared volumes - Cache npm/maven dependencies across workspaces
- Clean up old containers - Run
docker system pruneperiodically
Security
- Don’t expose Traefik externally - Keep it bound to localhost
- Use unique certificates per environment - Don’t share between machines
- Regenerate certificates periodically - mkcert certs expire after ~1 year
Performance
- Use Docker volumes for node_modules - Avoid mounting from host
- Adjust Vite polling interval - See Troubleshooting
- Monitor container resources - Use
docker stats
Related Guides
- Polyrepo Configuration - Multi-repository workspaces
- Workspaces - Workspace management
- Troubleshooting - Common issues