Your DevOps Revision Guide

Audio version created with Paper2Audio.

Listen on Paper2Audio

Technical Lead / Study Edition

Your DevOps Revision Guide

Understand the architecture. Explain the decisions. Show the evidence and the current limits.

A project-specific guide to your gateway, containers, databases, observability, recovery, and delivery pipeline.

How to use this pack

Read the guide with the source files open. Rehearse the presentation outline. Then take the companion 64-question Q.C.M without looking at its answers.

02 Your role and the current project

04 System map

06 Compose, lifecycle, and health

08 Images, builds, and reproducibility

10 ModSecurity, C.R.S, and request controls

12 The custom exporter and Docker socket boundary

14 Backups: implementation and limits

16 C.I/C.D and host deployment

18 Evidence map and official references 03 Architecture and technology choices

05 Trace a request through the system

07 Databases, volumes, and environment

09 Gateway, T.L.S, and certificate handling

11 Prometheus and Grafana

13 Alerts, status checks, and honest health claims

15 Recovery, safe demonstrations, and troubleshooting

17 Presentation rehearsal and revision checklist

Based on inspected repository configuration, not a new live deployment audit. Current implementation and proposed improvements are labeled separately. No credentials are included.

Your role and the current project

Your responsibility: define service boundaries, choose technologies with the team, own deployment and operation, and review changes that cross security or service boundaries. Explain a decision, its tradeoff, the implementation, and the evidence that it works.

Repository snapshot: commit 1320ac2, inspected 4 October 2026. This guide describes tracked configuration and source code. It is not a fresh production audit or evidence that a deployment ran successfully. No application configuration was changed to produce these materials.

- Compose contains 15 enabled services. Enabling identity would make 16. Identity's Postgresquel container is already enabled.

- Identity's Compose block, its Nginx upstream, and its /api/auth/ and /api/users/ routes are commented out. The Fastify /health route exists in source.

- Identity now uses Fastify, TypeScript, Prisma, and Postgresquel. The demo/ directory contains a legacy Java implementation. Its Prisma schema now contains models; older text saying it has no models is stale.

- Chat and organization use Spring Boot. Chat stores messages in MongoDB. Identity and organization have separate Postgresquel containers and volumes.

- The C.I workflow defines frontend checks, chat/org tests, and Compose/monitoring checks. Its S.S.H deployment job is commented out.

- Prometheus configures five scrape jobs. Gatus configures ten endpoints, including identity even though identity is disabled.

- The project has metrics, dashboards, status probes, and local logs. No enabled distributed tracing or centralized log collector appears in this Compose file.

A presentation opener you can adapt: "I defined the service boundaries with the team and owned how those services run together: the gateway, container topology, monitoring, recovery tools, and C.I checks. I can trace a request from the browser to its database, show how we detect failures, and explain the current limitations. The deployment workflow exists but is disabled in this snapshot, and identity is undergoing integration."

Only claim decisions and reviews you actually made. Use commits or pull requests to support your personal contribution. This guide does not infer authorship from file ownership.

Evidence: R.1, R.2, R.3, R.4, R.5, R.11.

Architecture and technology choices

Service ownership: identity owns accounts, authentication, tokens, and profile data; organization owns rooms, membership, and roles; chat owns message storage and real-time delivery. Keep writes to a service's data behind that service's A.P.I. Separate databases do not create distributed transactions.

- React + Vite: browser U.I and production static assets. A small Nginx container serves the built frontend.

- Spring Boot + Java 21: chat and organization, rest endpoints, Actuator/Micrometer integration, and g.R.P.C clients/servers.

• Fastify + TypeScript + Prisma: the current identity implementation. Review its runtime contract separately from the old Java demo.

• Postgresquel 16: relational identity and organization data. Unique constraints and relationships fit users, membership, and roles.

- MongoDB 7: chat documents. Review message indexes and query patterns instead of assuming a document database needs no schema discipline.

• rest: browser-facing request/response operations. WebSocket: long-lived chat connection. g.R.P.C + protobuf: typed internal service calls.

- Compose: a repeatable single-host development/deployment topology. It does not provide multi-host scheduling or host-level high availability here.

The tradeoff you must explain: service ownership lets teammates work on bounded areas and allows separate builds, but introduces network failure, contract compatibility, extra containers, and operational overhead. For a small product, a monolith would be simpler to operate; this project chooses service separation for its architecture and team responsibilities.

Dependency example: chat asks identity to validate a token and organization to check membership. Chat's default g.R.P.C deadline is 500 ms. Its identity client maps dependency failure to H.T.T.P 503 and an invalid token to authentication failure. Organization's identity client currently has no explicit per-call deadline; do not claim that every R.P.C is bounded.

Integration gap: the current Fastify entry point starts H.T.T.P. It does not start the identity g.R.P.C server expected by chat and organization. A dot proto file or Expose 9090 alone does not implement that server. Re-enabling the container requires contract verification, not only uncommenting yaml.

Review checklist: endpoint and protobuf compatibility, auth ownership, timeout behavior, error mapping, schema changes, service-name D.N.S, port agreement, and tests for unavailable dependencies.

Evidence: R.1, R.11, R.12. Technology rationale is an explanation to defend, not proof of the team's historical motives.

System map

Request and data paths at a glance. Internal authentication and membership calls use g.R.P.C; chat uses WebSocket for real-time browser traffic.

Image summary: A system architecture diagram showing a request flow starting from a Browser through Nginx, TLS, and WAF. This entry point connects to a middle layer of services including Frontend, Organization, and Chat, with Identity marked as disabled. These services then interface with a data layer consisting of Org PostgreSQL, MongoDB, and Identity PostgreSQL. The diagram illustrates a multi-tiered application structure separating the gateway, application logic, and database layers.

• Enabled route: browser to Nginx to organization to org-service postgres.

• Enabled route: browser arrow Nginx arrow chat arrow MongoDB.

- Current integration gap: chat and org expect identity g.R.P.C, while identity and its gateway routes are disabled.

Metrics path: application/exporter to Prometheus to Grafana; Prometheus alerts to Alertmanager to Discord.

Probe path: Gatus  configured H.T.T.P/T.C.P endpoints.

• Recovery path: databases to backup service to local ./backups to restore tools.

Scope of isolation

Each Postgresquel container has separate storage. Both applications still share the private network and several services receive the root environment file. This is not strict network or credential isolation.

Trace a request through the system

Organization rest example: the browser requests https://Domain/api/orgs/rooms. Host port 443 maps to Nginx container port 8443. Nginx terminates T.L.S, applies the relevant W.A.F/rate-limit rules, removes /api/orgs/, and forwards /rooms to org-service:8082. Organization uses org-service postgres:5432 for its database.

Chat rest: /api/chat/ becomes the corresponding path on chat-service:8081. Chat uses MongoDB and calls internal services for auth and membership. A healthy chat process does not prove those dependencies can satisfy a protected request.

WebSocket: /ws/chat passes to chat with H.T.T.P/1.1 and the Upgrade and Connection: upgrade headers. Nginx must preserve the protocol upgrade. The route has a W.A.F exclusion, so the application must enforce message validation, authentication, authorization, and abuse limits.

Frontend: the catch-all / proxies to frontend:80. Because identity routes are commented out, an identity A.P.I path may fall through to the frontend instead of reaching identity. A rendered page is not proof that login works.

Monitoring routes: /grafana/ and /prometheus/ strip their prefixes before proxying. /metrics.prom forwards to the custom Docker exporter. Gatus uses status.Domain; /status redirects there. A separate status hostname keeps Gatus assets and A.P.I paths consistent.

Headers: Host identifies the requested virtual host. X-Real-I.P and X-Forwarded-For carry client-address information. X-Forwarded-Proto tells the upstream that the browser used H.T.T.P.S. If you add another proxy, review trust rules before using forwarded addresses for security or rate limits.

Network model: container-to-container calls use service names and container ports. Localhost inside organization means organization itself, not the Postgresquel container. Several containers can listen on 9090 or 5432 because each has its own network namespace.

Useful distinction: Nginx publishes host ports; expose documents internal ports. Reachability on the shared network depends on listening sockets and network membership, not an expose allowlist.

Rehearse by drawing: browser arrow gateway arrow application arrow database, then add the internal auth/membership calls and show where each connection can fail.

Evidence: R.1, R.2, R.11, R.12. See D.2 for Compose service semantics.

Compose, lifecycle, and health

The six Compose comment categories group gateway/frontend, application services, databases, observability, exporters, and recovery. The folders place exporters under monitoring/ and backups under databases/. Comments organize the file; they do not create separate deployment projects.

- build.context determines which files Docker can copy. dockerfile is relative to that context. A moved Dockerfile can break Copy unless references move too.

- depends on: condition: service healthy delays startup until the configured dependency check passes. service started waits for a running container, not application readiness.

- A health check's interval, timeout, retries, and start period control health classification. restart: always reacts to container exit; it does not restart a still-running process merely because its health becomes unhealthy.

• Organization's Compose check requests /healthz, whose controller returns Ok. Gatus instead checks /actuator/health and expects up. These checks have different depth.

Postgresquel uses pg isready; this is server-readiness evidence, not a successful application login and query. Gatus checks the database T.C.P socket, which is shallower still.

- Nginx's Compose check requests its H.T.T.P / route. A successful redirect response proves little about a complete authenticated journey.

- The private network has a name but no internal: true. The separate docker-metrics network explicitly has internal: true and connects the exporter with the socket proxy.

Memory budgets: chat, organization, and MongoDB each have a 1 gibibytes limit. Each Postgresquel container, Prometheus, Grafana, and backups has 512 mebibytes. These are limits, not reserved R.A.M. Budget for the host and simultaneous peaks; a limit can cause an O.O.M termination.

Commands to understand:

Code summary: This sequence of Docker Compose commands manages the lifecycle of a specific service named org-service. It first validates the configuration and checks the status of all containers to ensure environment stability. It then retrieves the 100 most recent logs from the postgres database to diagnose potential issues before rebuilding and launching the service in detached mode. Finally, it restarts the service to apply changes or refresh its state.

restart does not reload changed container environment settings; recreate the service with up when configuration changes. D.3 down normally preserves named volumes. down --volumes removes the stack's named volumes; bind-mounted./backups is a host directory, not one of those volumes.

Evidence: R.1, R.6, R.11; D.1–D.3. Avoid projecting all dependency health onto one green check.

Databases, volumes, and environment

Current storage: identity-service postgres uses volume database; org-service postgres uses org-service_postgres data. MongoDB uses mongo data. Other volumes store Grafana data, Prometheus data, T.L.S files, and the disabled identity service's avatars. Container replacement and volume deletion are different operations.

The Postgresquel image creates its initial user and database from Postgres User, Postgres Password, and Postgres D.B only when its data directory is empty. Changing these variables later does not alter existing roles or create a second database in an initialized cluster.

Compose maps the namedspaced Identity Postgres asterisk and Org Postgres asterisk variables into each database container's generic Postgres asterisk variables. Organization receives matching Spring datasource credentials; identity's Database U.R.L must match its own host, database, and U.R.L-encoded credentials.

Database versus schema: the image can create an empty database. Organization currently uses Hibernate ddl-auto: update to manage tables. Identity has a Prisma schema, but its Dockerfile does not run migrations or explicit Prisma generation. No checked-in migration files were found during this review.

For controlled releases, define one schema-migration owner per service. Flyway is a possible org choice; Prisma Migrate fits identity. This is proposed work, not current behavior.

Environment lessons:dot env supplies Compose interpolation; env file injects variables into containers. A service's explicit environment settings override the same keys from env file. Quote and interpolation rules matter. $$ in a Compose command defers a dollar sign to the container shell.

Real incident to explain: organization exited during initdb because it received the literal username ${Postgres User}. The split had preserved an old variable reference as a value. The fix resolved the credentials, checked database/app/backup agreement, recreated affected containers, and verified authentication and backup completion. A syntactically valid Compose file had not caught the semantic error.

Security limits: separate containers and volumes do not enforce database access isolation when apps share a network and broad dot env injection. Use service-specific secrets and restricted database roles as follow-up work. Do not display dot env or expanded Compose output in a presentation.

Evidence: R.1, R.7, R.11; D.4-D.6. The incident comes from this working session, not an inferred repository audit trail.

Images, builds, and reproducibility

Frontend: build with Node 22 using npm ci and npm run build, then copy dist into an Nginx runtime image. The runtime serves static files; it does not need the Vite development server.

Spring services: compile with Java 21/Maven, produce a Jar, build a reduced runtime with jlink, and run it in Alpine as user app. Docker builds skip tests; GitHub Actions runs chat/org Maven tests separately. A successful image build does not replace test execution.

Identity: a Node multi-stage build runs npm ci, TypeScript compilation, and npm prune --omit=dev. The runtime uses user node. The Dockerfile uses node:lts-alpine, a moving tag; Expose 8083 9090 supplies metadata and does not start servers or publish ports.

Gateway: starts from the ModSecurity C.R.S Nginx image, installs dependencies as root, copies configuration, prepares writable paths, and switches to user nginx. Its entrypoint prepares T.L.S/configuration before invoking the base entrypoint with exec.

Exporter: a small Alpine image with Bash, curl, jq, and BusyBox runs as U.I.D 65534. Its H.T.T.P service serves a generated metrics file.

Build hygiene: root and relevant component dot dockerignore files exclude dependency/build directories, dot env files, certificates, keys, and backups. dot gitignore controls Git tracking; it does not control Docker's build context. A secret can enter an image even if Git ignores it unless the build context also excludes it.

Reproducibility discussion: npm ci uses a lockfile, but moving image tags and repository package installs can change results between builds. Pin important images or digests for a release; keep dependency lockfiles; record the tested commit. These are improvement options, not guarantees the current images provide.

Build review checklist: context size, correct Copy sources, lockfile use, no secret files in layers, executable permissions, writable runtime paths for non-root users, platform compatibility, health-command availability, and dependency readiness.

Command comparison: make build rebuilds and starts the stack; make up starts it without requesting a rebuild. make re combines clean and build. make fclean deletes volumes and runs docker system prune -a, which also affects unused images outside this project. Use that target only when you intend that broader cleanup.

Evidence: R.1, R.6, R.10, R.11. Recommendations are release-review criteria.

Gateway, T.L.S, and certificate handling

Gateway responsibilities: terminate browser T.L.S, select upstreams, rewrite route prefixes, pass protocol/client metadata, apply request controls, and expose selected monitoring views. Domain authorization and room permissions remain application responsibilities.

Nginx listens inside its container on 8080 and 8443. Compose publishes 80 to 8080, 443 to 8443, 8000 to 8080, and 8443 to 8443. H.T.T.P requests to / receive a redirect to https slash dollar sign host dollar sign request underscore uri. That redirect uses the standard H.T.T.P.S U.R.L; it does not preserve a custom incoming H.T.T.P port.

T.L.S settings: T.L.S 1.2/1.3, configured cipher restrictions, and a 10 mebibytes request-body limit. H.T.T.P.S protects browser-to-gateway transport. Internal upstream H.T.T.P and the inspected g.R.P.C clients use plaintext on Docker networks; do not claim end-to-end T.L.S or mutual T.L.S.

Startup script: validate Domain as a bare hostname; substitute only dollar sign curly bracket Domain curly bracket in the Nginx template so dollar sign host and rewrite captures survive. Check for mounted Certbot-style fullchain.pem/privkey.pem, then server.crt/server.key. Copy a complete readable pair into the persisted T.L.S directory. Fail when a supplied pair is incomplete or unreadable.

If no mounted pair exists and the persisted pair is missing, generate a self-signed R.S.A-2048 certificate valid for 365 days with S.A.N entries for the domain, www, status, and local names. Store it in the nginx tls volume. The private key gets mode 600; the certificate gets 644.

Explain trust: a self-signed certificate can encrypt a connection, but the browser does not trust its issuer by default. A publicly trusted certificate also needs matching D.N.S names, correct D.N.S records, readable files, and a renewal/deployment process. Installing Certbot in a setup script does not prove renewal is automated.

Read-only demonstration:

docker compose exec nginx nginx -t curl -I http://localhost:8000/ curl -kI https://localhost:8443/

-k skips certificate verification for a local self-signed demo; it does not fix certificate trust. Check the live configuration with care because configuration/log output can include operational details.

Evidence: R.1, R.2, R.9. Review the actual host/D.N.S/certificate setup before a live presentation.

ModSecurity, C.R.S, and Request Controls

ModSecurity provides the inspection engine; the owasp Core Rule Set supplies detection rules for common attack patterns such as S.Q.L injection and cross-site scripting. The gateway enables the engine and request-body inspection. Response-body inspection is disabled in the override.

The checked-in Compose configuration sets modsec_rule Engine equals on, Paranoia equals 1, and Blocking Paranoia equals 1. The override also says SecRuleEngine On. A different value in the root dot env does not override a hardcoded Compose value. Present the rendered/running configuration when demonstrating a mode change.

Paranoia level: higher levels add stricter checks and can increase false positives. Tune from observed rule I.D's, affected routes, and legitimate request examples. Prefer narrow rule exclusions where possible; test that a fix for legitimate traffic does not open unrelated routes.

Current exclusions: /ws/, Grafana, and Prometheus have exclusions; Nginx also disables ModSecurity on metrics and the Gatus virtual host. These choices support protocol/tool compatibility but reduce gateway inspection on those paths. The application and each tool still need validation and access controls.

Rate limiting: Nginx defines an A.P.I zone keyed by client I.P at 20 requests/second, with a burst of 30 and nodelay on enabled org/chat A.P.I locations. Excess requests use H.T.T.P 429. This is per-key gateway throttling, not per-user authorization, not a global cap across all traffic, and not protection for WebSocket messages after the upgrade.

Monitoring access: Prometheus, metrics, and nginx status allow loopback and R.F.C1918 address ranges before denying others. Broad private ranges are not user authentication. Verify the client address that Nginx actually sees through Docker or any external proxy. Grafana handles its own login; Gatus uses Basic Auth with its configured password hash.

Threat examples: prepared S.Q.L and server validation protect database operations; W.A.F inspection adds a perimeter layer. J.W.T verification establishes an identity; membership checks decide access to a room. T.L.S protects transport. Each control addresses a different failure mode.

Good review answer: "I check the route, rule I.D, request body, effective client I.P, authentication, and application logs before changing a security rule. I keep a regression example for the legitimate request."

Evidence: R.1, R.2, R.5; D.7. No attack traffic was sent while preparing this guide.

Prometheus and Grafana

Metrics flow: applications/exporters expose numeric time series leads to Prometheus scrapes and stores them leads to PromQL selects or aggregates them leads to Grafana displays queries. Logs describe events; traces follow requests across services. A metric dashboard is not a log archive or a distributed trace.

Five configured jobs: Prometheus itself, Docker exporter at /metrics.prom, chat at /actuator/prometheus, organization at /actuator/prometheus, and nginx-exporter:9113. Global scrape and rule-evaluation intervals are 15 seconds; chat and organization scrape every 10 seconds. Identity has no configured metrics scrape.

Metric types: counters accumulate events or work and may reset on restart; gauges represent current values such as memory use; histograms aggregate observations into buckets. Use rate(counter[window]) for a per-second rate instead of reading a cumulative counter as current throughput.

Queries you should explain:

Code summary: This set of Prometheus queries monitors the health and resource utilization of the org-service. The first query filters for the specific service job; the second calculates the per-second request rate over a five-minute window to measure throughput; and the third determines the percentage of allocated memory currently in use relative to the container limit to monitor for potential memory exhaustion.

The first measures scrape success, not a successful user workflow. The second measures request rate over a window. The memory ratio needs a meaningful, nonzero limit; the project's alert filters nonpositive limits.

The project's CPU query divides container C.P.U-time growth by host C.P.U-time growth. Its threshold refers to total host capacity, not a single-core percentage. Network counters currently use eth0, so do not claim that the custom exporter sums every interface on a multi-network container.

Grafana provisioning: the datasource points to http://prometheus:9090, uses U.I.D prometheus, and is not editable through the U.I. Dashboard provisioning reads files every 10 seconds. jay-sun configuration makes dashboards reviewable and repeatable. The microservice dashboard includes health, request rate, 5xx rate, J.V.M heap, and container CPU.

Troubleshooting an empty panel: check the selected time range, datasource connectivity, Prometheus target status, available metric names, labels, query expressions, and whether the service emits that metric. A Java J.V.M panel cannot describe Fastify memory without different instrumentation.

Evidence: R.3, R.4, R.11. PromQL examples are study queries; no live metric results are asserted here.

The custom exporter and Docker socket boundary

The Docker exporter retrieves container metadata, stats, and inspect information through docker-socket-proxy:2375. It does not mount the Docker socket itself. The proxy mounts the socket and joins only docker-metrics; the exporter joins both docker-metrics and private so Prometheus can scrape it.

Proxy policy: enable container reads with containers=1, disable writes with post=0, and disable several unrelated endpoints. A read-only socket mount by itself does not make requests through that socket read-only; the proxy's A.P.I policy supplies that restriction. The proxy remains a sensitive Docker control-plane component.

Collection behavior: at most four concurrent workers; each curl request has a 1-second connection timeout and a 3-second maximum duration. Each worker checks required C.P.U/memory fields and restart-count data. Missing stats cause collection failure rather than believable zeros.

The collector produces a complete temporary file, appends health metrics, and renames it to metrics.prom. The H.T.T.P server runs separately from the collector, so a slow Docker response does not block H.T.T.P serving. After a collection failure, the output contains health information instead of stale container samples presented as fresh.

Self-monitoring: docker_exporter_collection success reports whether the last collection succeeded; docker_exporter_last_success_timestamp seconds identifies the last complete success. H.T.T.P 200 only proves the server answered. Evaluate the collection metric and sample age too.

Metrics: container memory usage/limit, CPU counters, eth0 network counters, aggregate block I/O bytes, restart count, and a host-uptime metric. Dynamic discovery requests running containers; a stopped container can disappear from the series. Missing series need explicit reasoning, not automatic interpretation as zero.

The process supervises both collector and H.T.T.P server with wait -n; when either exits, cleanup terminates the remaining process. Docker's restart policy can then restart the container.

Review questions: Can an A.P.I request hang? Can partial samples leak? Are label values escaped?

Is collection concurrency bounded? Does exporter availability imply Docker A.P.I availability? How would you detect a stopped container that disappeared from discovery?

Evidence: R.1, R.4. The project's monitoring test script exercises exporter behavior with controlled responses.

Alerts, status checks, and honest health claims

Prometheus evaluates alert conditions. Alertmanager receives firing alerts, groups/deduplicates them, and routes notifications. Grafana displays data.

Gatus actively probes configured endpoints. Keep these roles distinct.

Five configured alert rules:

- MicroserviceDown: chat/org scrape up = 0 for 30 seconds.

• HighContainerCpuUsage: more than 85% of host CPU capacity for 2 minutes.

• HighContainerMemoryUsage: more than 85% of container memory limit for 2 minutes.

- HighHttp5xxErrorRate: more than 5% 5xx responses over a 5-minute rate window, sustained for 1 minute.

• DockerExporterUnhealthy: scrape failure, collection failure, or last-success age above 60 seconds, sustained for 1 minute.

A rule's for duration filters brief events; total notification delay also includes scrape/evaluation timing and Alertmanager grouping. A missing target series is not equivalent to an existing series with up = 0. Do not promise that these rules detect every outage or O.O.M.

Alert delivery: group by alert name/container, wait 10 seconds for a first group, use a 10-second group interval, repeat after 1 hour, and send resolution notifications. The startup wrapper validates a Discord webhook, renders a template under /tmp with restrictive file permissions, and does not print the credential. A missing webhook makes Alertmanager fail to start.

Gatus: ten endpoints every 10 seconds. H.T.T.P checks examine status and selected jay-sun fields; database checks open T.C.P connections. Storage is memory, so status history disappears on container restart. Basic Auth uses a bcrypt password hash encoded as base64; base64 is encoding, not encryption.

Expected mismatch: Gatus still probes identity, which is disabled. Its failed probe would reflect current configuration rather than a newly discovered production incident. Also, org /healthz is a shallow process check while /actuator/health can report dependencies.

Test evidence: monitoring/scripts/test-monitoring.sh checks Compose, exporter behavior, Prometheus rules with promtool, and Alertmanager configuration with amtool, including invalid webhook inputs. It does not send a real Discord notification or prove an entire user journey work.

Evidence: R.3, R.4, R.5. General alert-delivery concepts: D.8.

Backups: implementation and limits

The backup service waits for both Postgresquel containers and MongoDB at startup. It takes one snapshot immediately, then sleeps 43,200 seconds after a run before the next one. The cycle is roughly 12 hours plus backup duration. Retention defaults to seven days for timestamped files, while latest files remain.

Postgresquel: connect to each host with that service's credentials, run pg dump --clean --if-exists --format=p, then compress with gzip -9. Identity files use postgres Timestamp.sql.gz; org files use org Timestamp.sql.gz. Do not confuse the historic postgres filename prefix with the old shared container.

MongoDB: write a gzip archive with mongodump. The current daemon does not pass --db, so do not claim it backs up only chatdb; the actual scope depends on the credentials and accessible databases. Its auth defaults can reuse the root account, which deserves review.

Storage: /backups binds to repository ./backups. This survives container replacement but resides on the same host. The script adds no encryption, off-site copy, immutable retention, or W.A.L/oplog continuous recovery.

Latest files update only after all dumps succeed. The code uses sequential cp -f calls, so the set of latest files is not an atomic multi-file update, despite an "atomically" comment. Postgresquel dump errors fail the shell pipeline because it enables pipefail.

MongoDB failure preserves previous latest files but the script can still print a general success message afterwards. Inspect the specific outcomes, not that message alone.

R.P.O: how much recent data you can afford to lose. A 12-hour schedule suggests a roughly 12-hour exposure under successful operation, with backup duration and failures extending it. It is not a measured guarantee. R.T.O: how long restoring service takes; measure a complete recovery exercise.

Three sequential database dumps are not a coordinated cross-service transaction snapshot. Restoring them may need reconciliation across accounts, room membership, and messages. A database-only backup also does not include the avatar volume, T.L.S materials, or deployment secrets.

Improvement priorities: verify backup freshness, expose failure metrics, keep off-site encrypted copies, test restoration, measure R.P.O/R.T.O, and define the required application-consistent recovery point.

Evidence: R.1, R.7. Limits come from reading the scripts, not from executing a disaster test during this review.

Recovery, safe demonstrations, and troubleshooting

Manual tools: make backup creates snapshots; make restore SNAPSHOT=Timestamp selects a snapshot; no timestamp selects latest. The restore script terminates Postgresquel sessions, executes clean S.Q.L dumps, and uses MongoDB mongorestore --drop. Stop application writes when performing a planned restore.

Recovery test: insert recognizable records  take backups  delete the test records  restore  verify the values and clean up. The restore affects full backed-up databases, not only the test rows. Run it only in an isolated disposable stack; it can overwrite writes made after the snapshot.

Safe presentation checks:

Code summary: This sequence of Docker Compose commands serves as a health and configuration check for a multi-service environment. It first validates the configuration syntax and checks the status of all containers, then retrieves the last 50 log entries from the postgres database to diagnose potential issues. Finally, it verifies the Nginx configuration and performs connectivity and health checks on the org-service via local HTTP endpoints to ensure the application is fully operational.

These inspect configuration and health. Do not paste full expanded environment settings into a recording. Starting builds, restarting containers, or running recovery tools changes the system; rehearse in a dev stack.

Exit 1: inspect the first fatal log line, exit code, configuration, and mounts. The recent organization incident was an invalid literal username, not a port collision. Exit 137: check oomkilled and host logs; a sigkill exit can have causes other than O.O.M.

502 from Nginx: check the matching route, upstream service/D.N.S/port, container state, and direct upstream reachability. 401 versus 503: invalid credentials and unavailable identity are different conditions. Chat distinguishes them; org's auth filter currently maps exceptions to 401, which can obscure dependency outages.

No metrics: check the scrape target, exporter collection status, last-success age, metric labels, and dashboard query. No alerts: trace target arrow rule expression arrow pending or firing state arrow Alertmanager route arrow receiver, without exposing the webhook.

Postgresquel accepts T.C.P but app fails: verify the database name, role, password, schema, and permissions with an authenticated query. A port probe cannot establish those facts.

Tech lead habit: record the symptom, evidence, root cause, smallest fix, verification, and a regression check. Keep an incident explanation factual; distinguish the observed cause from an untested theory.

Evidence: R.2, R.3, R.7, R.12. Commands above were prepared for revision, not executed as a live recovery exercise.

C.I/C.D and host deployment

Workflow triggers: pushes to main and pull requests targeting main. Frontend job: checkout, Node 22, lockfile cache, npm ci, EsLint, production build. Backend matrix: Java 21 and ./mvnw test -q for chat and organization, with fail-fast: false. Identity tests exist in its package but are not a job in this workflow.

Configuration job: copy dot env.example into a C.I dot env, then run monitoring/scripts/test-monitoring.sh. This exercises monitoring checks; it does not build every application image or run an end-to-end user scenario. A green workflow has the scope of its actual checks.

Current deployment state: the entire deploy job is commented out. You can say you implemented the deployment workflow and script, but this file does not currently trigger automatic deployment on merge. The disabled design requires all test jobs, passes github.sha, and serializes deployment through a concurrency group.

Deployment script safeguards: require a 40-character commit S.H.A, check that local Head matches it, reject a dirty tracked/untracked worktree, require dot env, select the Docker socket, build/start with --remove-orphans, restart Nginx, prune dangling images, and display status. An ignored dot env is intentionally outside the Git cleanliness check.

The script does not implement a health-gated rollout, automated rollback, or zero-downtime deployment. It builds on the server rather than deploying immutable image digests from a registry. Nginx restarts can interrupt connections; database migration compatibility complicates rollback.

Host setup script: install packages and Docker, configure Docker jay-sun-log rotation at 20 M.B × 3 files, add the operator to the Docker group, open selected host firewall ports, and prepare certificates. Docker group membership grants powerful host control. Cloud firewall rules, D.N.S, S.S.H access, architecture, and available R.A.M still need verification. Script presence is not evidence it ran on a V.M.

Review/release improvements: add identity and integration checks, pin actions/images for releases, decide migration and rollback procedures, perform post-deployment health checks, and protect deployment environments when enabled. GitHub environment reviewers can gate deployment jobs; no such active approval gate is shown here.

Evidence: R.6, R.8, R.9, R.11. Check workflow files rather than describing intended automation as enabled behavior.

Presentation rehearsal and revision checklist

A 7-minute structure:

- 0:00 to 0:45: your ownership and the current implementation status.

- 0:45 to 2:00: service boundaries, technologies, and one request from browser to database.

- 2:00 to 3:00: Compose topology, health dependencies, volumes, and the database split.

- 3:00 to 4:00: T.L.S, W.A.F rules/exclusions, and application authorization.

- 4:00 to 5:00: scrape to query to dashboard to alert to notification; explain Gatus separately.

- 5:00 to 6:00: backup schedule, restoration evidence, R.P.O/R.T.O, and current backup limits.

- 6:00 to 7:00: C.I gates, disabled C.D, review responsibilities, and two next improvements.

Revise until you can explain without reading:

- Image, container, build context, network, bind mount, and named volume.

• Container D.N.S versus localhost; internal ports versus published host ports.

• Started, healthy, ready, and an authenticated user journey.

• dot env interpolation versus container injection; literal placeholders and recreation.

• Postgresquel initialization versus table migrations; Hibernate versus Prisma ownership.

- T.L.S termination, certificate trust, reverse proxying, WebSocket upgrades, W.A.F tuning.

• Authentication, authorization, rate limits, and the limits of private-network trust.

• Counters, gauges, rates, labels, scrape interval, alert for, and missing series.

- xporter H.T.T.P availability versus collection health; Docker socket permissions.

• Backup integrity, restoration, retention, off-site storage, R.P.O, and R.T.O.

- C.I versus delivery/deployment; tested commit identity, release health checks, rollback.

- Contract compatibility, timeout/error behavior, and how you review critical changes.

Three-session plan: first trace architecture/Compose/gateway in the files; next inspect monitoring and walk through a recovery dry run; last read C.I/deployment, take the quiz, and present aloud. Revisit any answer you guessed, even if it was correct.

Current gaps to acknowledge: identity disabled and g.R.P.C integration incomplete; org R.P.C deadline/error mapping differs from chat; /healthz is shallow; backups stay on one host and latest-file updates are non-atomic; shared network/environment access is broad; C.D is disabled; moving image tags and incomplete C.I coverage limit release confidence.

Prepare evidence: a topology sketch, relevant code locations, a sanitized health/dashboard view, a prior successful isolated restore result, and the workflow showing its actual enabled jobs. Describe planned changes as planned. Do not run destructive recovery or cleanup commands on a live demonstration stack.

Evidence: R.1–R.12. Use the companion 64-question Q.C.M, then check the explanations at its end.

Evidence map and official references

Repository evidence (paths are relative to the project root):

- R.1: docker-compose.yml.

- R.2: gateway-frontend/gateway/ to nginx.conf, script.sh, Dockerfile, modsec/modsecurity-override.conf.

- R.3: monitoring/prometheus/  prometheus.yml, alert rules.yml, alertmanager.yml, start-alertmanager.sh.

- R.4: monitoring/metrics-exporters/docker-exporter/ to script.sh, test.sh, Dockerfile; monitoring/grafana/ to datasource, provider, and dashboard files.

- R.5: monitoring/status-page/config.yaml.

- R.6: Makefile, dot dockerignore, component Dockerfiles, and dot gitignore.

- R.7: and databases/backup-recovery/scripts/.

- R.8: dot github/workflows/ci-cd.yml, monitoring/scripts/test-monitoring.sh.

- R.9: deploy/deploy.sh, deploy/setup-vm.sh, deploy/read me.md

- R.10: gateway-frontend/frontend/Dockerfile, application/chat-service/Dockerfile, application/org-service/Dockerfile, application/identity-service/Dockerfile.

- R.11: service src/main/resources configs; identity src/app.ts, src/server.ts, package.json, prisma/schema.prisma, and prisma7.config.ts; org HealthController.java.

- R.12: chat grpc/IdentityClient.java and OrgClient.java; org client/IdentityGrpcClient.java and config/JwtAuthenticationFilter.java under their src/main/java trees.

Official reading, checked 4 October 2026:

- D.1: Docker Compose startup order.

- D.2: Compose services reference.

- D.3: Compose restart and configuration changes.

- D.4: Official Postgresquel image instructions.

- D.5: Compose interpolation and environment precedence.

- D.6: Spring Boot database initialization and Prisma 7 migrations.

- D.7: owasp C.R.S false positives and tuning.

- D.8: Prometheus Alertmanager concepts.

- D.9: GitHub deployments and environments.

Read implementation files before older readmes when they disagree. Paths and behavior in this guide describe the inspected snapshot; check your current branch before presenting.