Deployment Overview
Deployment architecture, environment requirements, Docker vs bare metal considerations, and networking
Architecture
MQUAD is deployed as a set of Docker containers orchestrated via Docker Compose. All services run on a shared mquad-network bridge network with Traefik as the ingress gateway.
Environment Requirements
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8+ cores |
| RAM | 8 GB | 16+ GB |
| Disk | 50 GB | 100+ GB SSD |
| Docker | 24+ | 24+ |
| OS | Linux/macOS | Linux (production) |
Docker vs Bare Metal
| Aspect | Docker (Recommended) | Bare Metal |
|---|---|---|
| Setup | Single command | Manual per service |
| Isolation | Container-level | Process-level |
| Scaling | Horizontal via Compose | Manual |
| Networking | Built-in bridge | Manual config |
| Port conflicts | Isolation via containers | Potential conflicts |
| Upgrade | Rolling rebuilds | Per-process |
Networking
All containers attach to the mquad-network bridge:
networks:
mquad-network:
driver: bridge
name: mquad-networkService discovery uses Docker DNS — services resolve each other by container name (e.g., http://survey-service:8001).
Environment Files
| File | Location | Purpose |
|---|---|---|
.env | Project root | Shared environment variables |
backend/.env | backend/ | Backend-specific settings |
survey-service/.env | survey-service/ | Survey service settings |
Configuration Pattern
# .env (project root)
ENVIRONMENT=development
HOST_MAIN_DOMAIN=mquad.local
LOG_JSON=true
# Service-specific .env
DATABASE_URL=postgresql+asyncpg://appuser:appsecret@postgres:5432/survey_db
REDIS_URI=redis://:${REDIS_PASSWORD}@redis:6379Shared Module
The common/ directory is mounted into every service container at /opt/common:
volumes:
- ./common:/opt/commonEach service must add this to Python path before importing:
import sys
sys.path.insert(0, "/opt/common")