Files
kms/examples/aws-cloudhsm/compose.yml
T
zandGitHub 701c06abda chore(examples): drop orphaned Redis from HSM deploy examples (#15)
The current KMS is a pure Go binary. Per DEPRECATED.md the Node.js +
PostgreSQL + Redis Infisical fork was replaced — "no Node.js / Postgres /
Redis dependencies." The KMS Go runtime contains zero Redis references;
the `REDIS_URL` / `REDIS_HOST` knobs in these examples were leftover from
the deprecated stack and are never read.

Remove the orphaned Redis declarations from the three HSM compose examples
and the Zymbit k8s manifest:
- zymbit-hsm/compose.yml: redis service, REDIS_URL env, depends_on, volume
- zymbit-hsm/kubernetes-deployment.yaml: Redis Deployment/Service/PVC,
  REDIS_HOST/PORT ConfigMap keys, redis egress NetworkPolicy rule
- aws-cloudhsm/compose.yml: redis service, REDIS_URL env, depends_on, volume
- google-cloud-hsm/compose.yml: redis service, REDIS_URL env, depends_on, volume

No consumer migration needed — nothing read Redis. Postgres left intact.
2026-06-16 16:09:27 -07:00

118 lines
2.9 KiB
YAML

version: '3.8'
services:
# Lux KMS with AWS CloudHSM
kms:
image: luxfi/kms:latest
container_name: lux-kms-cloudhsm
restart: unless-stopped
# Use host network for CloudHSM connectivity
# CloudHSM client requires direct network access to HSM IPs
network_mode: "host"
environment:
# AWS CloudHSM Configuration
AWS_CLOUDHSM_CLUSTER_ID: "${AWS_CLOUDHSM_CLUSTER_ID}"
AWS_CLOUDHSM_PIN: "${AWS_CLOUDHSM_PIN}"
AWS_CLOUDHSM_LIB_PATH: "/opt/cloudhsm/lib/libcloudhsm_pkcs11.so"
AWS_REGION: "${AWS_REGION:-us-east-1}"
# HSM Slot and Key Configuration
HSM_SLOT: "0"
HSM_KEY_LABEL: "${HSM_KEY_LABEL:-lux-kms-key}"
# Optional: Disable health check (not recommended for production)
# AWS_CLOUDHSM_HEALTH_CHECK: "false"
# AWS Credentials (use IAM instance role in production)
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
# AWS_SESSION_TOKEN: "${AWS_SESSION_TOKEN}" # If using temporary credentials
# KMS Application Configuration
NODE_ENV: "production"
PORT: "8080"
DB_CONNECTION_STRING: "postgresql://kms:password@postgres:5432/kms"
# Logging
LOG_LEVEL: "info"
volumes:
# Mount CloudHSM client libraries and configuration
- /opt/cloudhsm:/opt/cloudhsm:ro
# Mount cluster certificate
- ./cluster.crt:/opt/cloudhsm/etc/cluster.crt:ro
# Mount client configuration
- ./cloudhsm_client.cfg:/opt/cloudhsm/etc/cloudhsm_client.cfg:ro
# Application data
- kms-data:/app/data
depends_on:
- postgres
# Health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Resource limits
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
# PostgreSQL database
postgres:
image: ghcr.io/hanzoai/sql:latest
container_name: lux-kms-postgres
restart: unless-stopped
environment:
POSTGRES_DB: kms
POSTGRES_USER: kms
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- kms-internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U kms"]
interval: 10s
timeout: 5s
retries: 5
# Optional: CloudHSM client sidecar (for initialization tasks)
cloudhsm-client:
image: amazonlinux:2
container_name: cloudhsm-client
network_mode: "host"
volumes:
- /opt/cloudhsm:/opt/cloudhsm
command: tail -f /dev/null
profiles:
- tools
networks:
kms-internal:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
kms-data:
driver: local
postgres-data:
driver: local