NeXuS

Production Hardening

NeXuS includes a hardened Docker Compose configuration at infrastructure/docker/docker-compose-HARDENED.yml with additional security measures.

Hardening Checklist

Container Security

Network Security

Authentication

Monitoring

Secrets Management

Resource Limits Example

services:
  api:
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 512M
        reservations:
          cpus: '0.25'
          memory: 128M
    security_opt:
      - no-new-privileges:true
    read_only: true
    tmpfs:
      - /tmp
    cap_drop:
      - ALL

Backup Strategy

Database Backups

# PostgreSQL backup
docker exec nexus-postgres pg_dump -U seb nexus > backup.sql

# MongoDB backup
docker exec nexus-mongodb mongodump --username seb --password $MONGODB_PASSWORD --out /backup

# Redis backup (RDB snapshot)
docker exec nexus-redis redis-cli -a $REDIS_PASSWORD BGSAVE

Volume Backups

# Backup all volumes
docker run --rm -v nexus_postgres_data:/data -v $(pwd):/backup \
  alpine tar czf /backup/postgres-data.tar.gz /data