§170.315(h)(1) Direct Protocol round-trip testing - single & multi-peer configurations
10K+
Image: docker.io/mbrindam/direct-test-peer
Multiplatform image for §170.315(h)(1) Direct Protocol round-trip testing. Supports linux/amd64 and linux/arm64.
docker run -d \
--name direct-test-peer \
-p 8890:3003 \
-p 2526:2525 \
-e PEER_GATEWAY_URL=http://direct-gateway:3002 \
-v direct_test_peer_certs:/certs \
mbrindam/direct-test-peer:latest
Dashboard: http://localhost:8890
docker network create direct-peers
# Peer A
docker run -d \
--name direct-test-peer-a \
--network direct-peers \
-p 8890:3003 \
-p 2526:2525 \
-e DIRECT_DOMAIN=direct.test-peer-a.local \
-e PEER_GATEWAY_URL=http://direct-test-peer-b:3003 \
-e PEER_SMTP_HOST=direct-test-peer-b \
-v direct_test_peer_a_certs:/certs \
mbrindam/direct-test-peer:latest
# Peer B
docker run -d \
--name direct-test-peer-b \
--network direct-peers \
-p 8891:3003 \
-p 2527:2525 \
-e DIRECT_DOMAIN=direct.test-peer-b.local \
-e PEER_GATEWAY_URL=http://direct-test-peer-a:3003 \
-e PEER_SMTP_HOST=direct-test-peer-a \
-v direct_test_peer_b_certs:/certs \
mbrindam/direct-test-peer:latest
Dashboards:
See the project repository for docker-compose.yml configurations:
git clone https://github.com/mbrindam/direct-test-peer.git
cd direct-test-peer
docker compose up -d
docker compose -f docker-compose.yml -f docker-compose.two-peer.yml up -d
| Variable | Default | Description |
|---|---|---|
DIRECT_DOMAIN | direct.test-peer.local | Domain for cert generation and DNs |
CERTS_DIR | /certs | Directory for PKI files (mount a volume here) |
PEER_GATEWAY_URL | (empty) | URL of peer Direct gateway REST API (e.g., http://direct-gateway:3002) |
PEER_SMTP_HOST | (empty) | SMTP hostname of peer for outbound delivery |
PEER_SMTP_PORT | 2525 | SMTP port of peer |
Note: If PEER_GATEWAY_URL is empty, the peer will skip trust exchange on startup but remain operational. You can manually exchange trust via REST API.
All endpoints available at http://localhost:3003 (or your container's REST port).
POST /send — Send S/MIME Direct message with custom CDA XMLPOST /send-sample — Send a bundled sample (ccd-full, ccd-minimal, discharge-summary)GET /api/inbox — Received messages (JSON, newest first)GET /api/outbox — Sent messages (JSON, newest first)GET /api/stats — Message counts and trust statusGET /certs/ca — Own CA certificate (PEM)GET /certs/<address> — Address certificate (PEM)POST /certs/trust — Import trusted CA cert and nameGET /health — Service readiness checkSee repository README for detailed API examples.
| Port | Protocol | Description |
|---|---|---|
3003 | HTTP | REST API + web dashboard |
2525 | SMTP | Inbound S/MIME Direct messages |
Mount /certs to persist PKI data across container restarts:
-v my-certs-volume:/certs
This volume holds:
ca.key, ca.crt — Organization CA keypairdomain.key, domain.crt — Domain certificateaddr/ — Per-address certificatestrusted/ — Imported peer CA certificatestrust-bundle.pem — Combined trust storeTo reset PKI and start fresh:
docker volume rm my-certs-volume
docker run ... -v my-certs-volume:/certs mbrindam/direct-test-peer:latest
linux/amd64 (x86-64)linux/arm64 (ARM 64-bit, Apple Silicon, Raspberry Pi 4+)Automatically selected based on your Docker host. Explicit pull:
docker pull mbrindam/direct-test-peer:latest --platform linux/arm64
If your peer gateway (e.g., ClaudeEHR) runs in the same compose project:
services:
direct-test-peer:
image: mbrindam/direct-test-peer:latest
environment:
PEER_GATEWAY_URL: http://direct-gateway:3002
networks:
- default # Same network as direct-gateway
docker network create direct-peers
docker run ... --network direct-peers ... mbrindam/direct-test-peer:latest
| Scenario | Config | Why |
|---|---|---|
| Test §170.315(h)(1) compliance standalone | Two peers | No external EHR needed; full cross-org S/MIME validation |
| Integration test against ClaudeEHR | Single peer | Lightweight; validates integration with real EHR |
| Integration test against production Direct gateway | Single peer + PEER_GATEWAY_URL | Drop-in compliance validation |
| Local development & debugging | Single peer, docker run | Inspect C-CDA, test message handling |
| CI/CD pipeline validation | Two peers, docker compose | Automated round-trip testing |
Clone the repository and build:
git clone https://github.com/mbrindam/direct-test-peer.git
cd direct-test-peer
# Single-platform build
docker build -t my-direct-test-peer:latest .
# Multiplatform build (requires buildx)
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t my-direct-test-peer:latest \
.
Check logs:
docker logs direct-test-peer
Common issues:
PEER_GATEWAY_URL is correct and peer is runningcurl http://localhost:8890/api/stats# Get peer's CA
curl http://peer-gateway:3002/certs/ca | \
curl -X POST http://localhost:8890/certs/trust \
-H 'Content-Type: application/json' \
-d '{"name": "peer-ca", "cert": "@-"}'
Verify SMTP configuration:
PEER_SMTP_HOST must be reachable from containerPEER_SMTP_PORT must match peer's SMTP listener (usually 2525)Full source, documentation, and docker-compose configurations: https://github.com/mbrindam/direct-test-peer
MIT
Content type
Image
Digest
sha256:8ae547fd3…
Size
52.7 MB
Last updated
6 months ago
docker pull mbrindam/direct-test-peer