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

ResourceMinimumRecommended
CPU4 cores8+ cores
RAM8 GB16+ GB
Disk50 GB100+ GB SSD
Docker24+24+
OSLinux/macOSLinux (production)

Docker vs Bare Metal

AspectDocker (Recommended)Bare Metal
SetupSingle commandManual per service
IsolationContainer-levelProcess-level
ScalingHorizontal via ComposeManual
NetworkingBuilt-in bridgeManual config
Port conflictsIsolation via containersPotential conflicts
UpgradeRolling rebuildsPer-process

Networking

All containers attach to the mquad-network bridge:

networks:
  mquad-network:
    driver: bridge
    name: mquad-network

Service discovery uses Docker DNS — services resolve each other by container name (e.g., http://survey-service:8001).

Environment Files

FileLocationPurpose
.envProject rootShared environment variables
backend/.envbackend/Backend-specific settings
survey-service/.envsurvey-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:6379

Shared Module

The common/ directory is mounted into every service container at /opt/common:

volumes:
  - ./common:/opt/common

Each service must add this to Python path before importing:

import sys
sys.path.insert(0, "/opt/common")