docs(devops): update all documentation for DockerSpec compliance
- Replace all docker-compose.yml/docker-compose.monitoring.yml references with compose.yaml/compose.monitoring.yaml (modern Compose Spec naming) - Replace all `docker-compose` CLI commands with `docker compose` (plugin syntax) - Update Dockerfile stage descriptions: node:18-alpine → node:20.11-bookworm-slim, built-in node user → explicit nodeapp:1001 non-root user - Update image version references: postgres:14-alpine → postgres:14.12-alpine3.19, redis:7-alpine → redis:7.2-alpine3.19 - Externalize postgres credentials: hardcoded values → POSTGRES_USER/PASSWORD/DB env vars - Externalize Grafana admin password: hardcoded 'agentidp' → GF_ADMIN_PASSWORD env var - Add Docker Compose Variables section to environment-variables.md (POSTGRES_*, GF_ADMIN_PASSWORD) - Update local-development.md Step 3: cp .env.example .env, document POSTGRES_* purpose - Update quick-start.md: cp .env.example .env, use awk/sed for JWT key injection - Update 07-dev-setup.md: remove 'no .env.example' claim, reference cp .env.example - Update docker-compose.yml key file description in 04-codebase-structure.md - Update monitoring overlay launch commands across all docs (compose.yaml + compose.monitoring.yaml) - Update volume names to kebab-case: postgres_data → postgres-data, redis_data → redis-data - Fix compliance encryption-runbook: docker-compose restart agentidp → docker compose restart app All docs now consistent with compose.yaml in repo root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,12 +8,12 @@ This document covers building and running AgentIdP in production: Docker, enviro
|
||||
|
||||
The Dockerfile uses a two-stage build:
|
||||
|
||||
- **Stage 1 (builder):** `node:18-alpine` — installs all dependencies (including dev) and compiles TypeScript to `dist/`.
|
||||
- **Stage 2 (production):** `node:18-alpine` — copies `dist/` and `node_modules` (production only), runs as the built-in non-root `node` user.
|
||||
- **Stage 1 (build):** `node:20.11-bookworm-slim` — installs all dependencies (including dev) and compiles TypeScript to `dist/`.
|
||||
- **Stage 2 (final):** `node:20.11-bookworm-slim` — copies `dist/` and `node_modules` (production only), installs `curl` for healthcheck, and runs as the created non-root `nodeapp` user (UID 1001).
|
||||
|
||||
```bash
|
||||
# Build
|
||||
docker build -t sentryagent-idp:latest .
|
||||
docker build -t sentryagent-idp:1.0.0 .
|
||||
|
||||
# Run (supply required env vars)
|
||||
docker run -d \
|
||||
@@ -22,18 +22,18 @@ docker run -d \
|
||||
-e REDIS_URL=redis://<host>:6379 \
|
||||
-e JWT_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..." \
|
||||
-e JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n..." \
|
||||
sentryagent-idp:latest
|
||||
sentryagent-idp:1.0.0
|
||||
```
|
||||
|
||||
The container exposes port `3000`. Override with `PORT` environment variable if needed.
|
||||
The container exposes port `3000`. Override with `PORT` environment variable if needed. The container runs as non-root user `nodeapp` (UID 1001) — do not mount volumes requiring root ownership.
|
||||
|
||||
For local full-stack development, use Docker Compose instead:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
docker compose up --build -d
|
||||
```
|
||||
|
||||
The `docker-compose.yml` starts the app, PostgreSQL 14, and Redis 7 with health checks and data volumes.
|
||||
The `compose.yaml` starts the app, PostgreSQL 14.12, and Redis 7.2 with health checks, resource limits, restart policies, and data volumes — per DockerSpec standards.
|
||||
|
||||
---
|
||||
|
||||
@@ -178,11 +178,11 @@ The HTTP metrics (`agentidp_http_requests_total` and `agentidp_http_request_dura
|
||||
### Local Grafana
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
|
||||
docker compose -f compose.yaml -f compose.monitoring.yaml up -d
|
||||
```
|
||||
|
||||
- Prometheus: http://localhost:9090
|
||||
- Grafana: http://localhost:3001 (admin password: `agentidp`)
|
||||
- Grafana: http://localhost:3001 (admin password: `GF_ADMIN_PASSWORD` value from `.env`)
|
||||
|
||||
The monitoring compose overlay starts `prom/prometheus:v2.53.0` and `grafana/grafana:11.2.0`. Grafana dashboards and datasource provisioning are loaded from `monitoring/grafana/provisioning/`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user