File size: 2,519 Bytes
82f53e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# CRA Docker Production Validation Report

This report documents the verification and deployment sanity check of the Contract Risk Analyzer (CRA) Docker container stack.

---

## 1. Stack Status Summary
*   **Deployment Status**: `🟢 ACTIVE & HEALTHY`
*   **Host Ports Bound**: 
    *   `8080` (HTTP redirects to HTTPS)
    *   `8443` (HTTPS secure ingress)
    *   `8000` (LightML translator service)
*   **Active Services**:
    *   `cra-nginx-1`: Ingress routing & SSL termination
    *   `cra-app-1`: Main Flask/Gunicorn worker (Healthy)
    *   `cra-redis-1`: Key-value cache for rate-limiting
    *   `cra-lightml-translator-1`: Offline neural machine translation service

---

## 2. Container Configuration and Health Status

```bash
$ docker compose ps
NAME                       IMAGE                    COMMAND                  SERVICE              CREATED          STATUS                    PORTS
cra-app-1                  cra-app                  "gunicorn -w 1 --thr…"   app                  37 seconds ago   Up 36 seconds (healthy)   5000/tcp
cra-lightml-translator-1   cra-lightml-translator   "uvicorn app.main:ap…"   lightml-translator   38 seconds ago   Up 37 seconds             0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp
cra-nginx-1                nginx:alpine             "/docker-entrypoint.…"   nginx                6 seconds ago    Up 4 seconds              0.0.0.0:8080->80/tcp, 0.0.0.0:8443->443/tcp
cra-redis-1                redis:7-alpine           "docker-entrypoint.s…"   redis                38 seconds ago   Up 37 seconds             6379/tcp
```

---

## 3. Endpoint Availability & Logs

### Health Check Output (via HTTPS Proxy)
`$ curl -k -f https://127.0.0.1:8443/health`
```json
{
  "checks": {
    "database": "ready",
    "datasets": "ready",
    "model_cache": {
      "distilbert": "available",
      "qwen3": "missing"
    }
  },
  "encryption": {
    "enabled": false
  },
  "layer1": "ready",
  "layer2_distilbert": true,
  "layer3_scorer": "ready",
  "layer4_qwen": false,
  "retention_days": 30,
  "status": "healthy",
  "sydeco_mlp": true
}
```

---

## 4. Operational Assertions
*   **Networking Verification**: Nginx successfully routes traffic via reverse proxy to the Flask backend Gunicorn worker process on port 5000.
*   **Storage & Persistence**: Database files under `ldv-backend/data/` remain persistent across stack restarts.
*   **Restart Behavior**: All containers are configured with `restart: unless-stopped` to ensure automatic self-recovery.