version: '3.8' services: # Frontend Web Application frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "3000:3000" environment: - VITE_API_BASE_URL=http://localhost:8000 - VITE_WS_URL=ws://localhost:8000/ws depends_on: - backend networks: - security-tools-net restart: unless-stopped # Backend API Server backend: build: context: ./backend dockerfile: Dockerfile ports: - "8000:8000" environment: - BACKEND_HOST=0.0.0.0 - BACKEND_PORT=8000 - MCP_SERVER_URL=http://mcp-server:8001 - JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production - ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000 - DATABASE_URL=postgresql://security_user:security_pass@postgres:5432/security_db - REDIS_URL=redis://redis:6379/0 depends_on: - postgres - redis - mcp-server networks: - security-tools-net restart: unless-stopped volumes: - ./logs:/app/logs # MCP Security Tools Server mcp-server: build: context: ../ dockerfile: Dockerfile ports: - "8001:8000" environment: - MCP_SERVER_PORT=8000 - MCP_SERVER_HOST=0.0.0.0 - PYTHONUNBUFFERED=1 cap_add: - NET_RAW - NET_ADMIN security_opt: - no-new-privileges:true networks: - security-tools-net restart: unless-stopped volumes: - ./reports:/app/reports - ./logs:/app/logs # PostgreSQL Database postgres: image: postgres:15-alpine environment: - POSTGRES_DB=security_db - POSTGRES_USER=security_user - POSTGRES_PASSWORD=security_pass ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data - ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql networks: - security-tools-net restart: unless-stopped # Redis for Caching and Sessions redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data networks: - security-tools-net restart: unless-stopped # Nginx Reverse Proxy (Optional) nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/ssl:/etc/nginx/ssl depends_on: - frontend - backend networks: - security-tools-net restart: unless-stopped networks: security-tools-net: driver: bridge volumes: postgres_data: redis_data: