- Axum backend server: health check, transfer matrix cache (base64 BYTEA), route cache (JSONB), CORS, gzip compression, tracing - Postgres schema: transfer_matrices + cached_routes tables with upserts - Dockerfile.frontend: 3-stage (wasm-pack → SvelteKit → nginx:alpine) - Dockerfile.backend: 2-stage (rust build → debian:bookworm-slim) - nginx.conf: SPA fallback, WASM mime type, /api proxy to backend - docker-compose.yml: Postgres + backend for local development - K8s manifests: namespace, frontend/backend deployments with services, ingress routing, health probes, secret-based DATABASE_URL Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
63 lines
1.3 KiB
YAML
63 lines
1.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
namespace: mass-driver
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
containers:
|
|
- name: backend
|
|
image: mass-driver-backend:latest
|
|
ports:
|
|
- containerPort: 3001
|
|
env:
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: backend-secrets
|
|
key: database-url
|
|
- name: PORT
|
|
value: "3001"
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 256Mi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3001
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: 3001
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: backend
|
|
namespace: mass-driver
|
|
spec:
|
|
selector:
|
|
app: backend
|
|
ports:
|
|
- port: 3001
|
|
targetPort: 3001
|
|
protocol: TCP
|