release: WRNexusJS 0.8.0
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# WRNexus deployment operations
|
||||
|
||||
- Liveness: `GET /healthz`
|
||||
- Readiness: `GET /readyz` (includes registered dependency checks)
|
||||
- Migrations: run `bunx wrnexus db migrate --profile=production` once per release before scaling.
|
||||
- Shutdown: the Bun production server drains on SIGTERM/SIGINT.
|
||||
- Assets: `dist/public` files are content-addressed and may be cached immutably by a CDN.
|
||||
- Secrets: provide `DATABASE_URL` and `SESSION_SECRET` through the platform secret store; never commit production env files.
|
||||
- Logs: stdout/stderr are structured for platform collection. Configure OTLP for centralized telemetry.
|
||||
- Scaling: start with 250m CPU/256Mi memory, use readiness probes, and scale horizontally from request latency and CPU.
|
||||
@@ -0,0 +1,44 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: wrnexus
|
||||
spec:
|
||||
selector: { app: wrnexus }
|
||||
ports: [{ name: http, port: 80, targetPort: 3000 }]
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: wrnexus
|
||||
spec:
|
||||
replicas: 2
|
||||
selector: { matchLabels: { app: wrnexus } }
|
||||
template:
|
||||
metadata: { labels: { app: wrnexus } }
|
||||
spec:
|
||||
containers:
|
||||
- name: app
|
||||
image: ghcr.io/OWNER/APP:latest
|
||||
ports: [{ containerPort: 3000 }]
|
||||
envFrom: [{ secretRef: { name: wrnexus-secrets } }]
|
||||
livenessProbe: { httpGet: { path: /healthz, port: 3000 }, initialDelaySeconds: 5 }
|
||||
readinessProbe: { httpGet: { path: /readyz, port: 3000 }, initialDelaySeconds: 5 }
|
||||
resources:
|
||||
requests: { cpu: 250m, memory: 256Mi }
|
||||
limits: { cpu: "1", memory: 512Mi }
|
||||
lifecycle: { preStop: { exec: { command: ["sh", "-c", "sleep 5"] } } }
|
||||
terminationGracePeriodSeconds: 30
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: wrnexus-migrate
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: migrate
|
||||
image: ghcr.io/OWNER/APP:latest
|
||||
command: ["bunx", "wrnexus", "db", "migrate", "--profile=production"]
|
||||
envFrom: [{ secretRef: { name: wrnexus-secrets } }]
|
||||
@@ -0,0 +1,6 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
location /assets/ { root /srv/wrnexus/dist/public; expires 1y; add_header Cache-Control "public, immutable"; }
|
||||
location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Request-ID $request_id; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Description=WRNexus application
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/srv/wrnexus
|
||||
EnvironmentFile=/etc/wrnexus/wrnexus.env
|
||||
ExecStartPre=/usr/bin/bunx wrnexus db migrate --profile=production
|
||||
ExecStart=/usr/bin/bun dist/server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
TimeoutStopSec=30
|
||||
User=wrnexus
|
||||
Group=wrnexus
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/srv/wrnexus
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user