Skip to content

Add docker-compose-swarm.yml aligned with sibling NRA apps - #110

Merged
buzz-code merged 4 commits into
mainfrom
claude/network-data-rum-integration-c0zvc1
Jul 13, 2026
Merged

buzz-code merged 4 commits into
mainfrom
claude/network-data-rum-integration-c0zvc1

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • Adds docker-compose-swarm.yml, bringing react-admin-nestjs's production Swarm stack in line with event-management-nra, teacher-report-nra, student-report-nra, and dnd-management-nra: client/server services, Caddy labels via caddy-docker-proxy, health checks, and env vars sourced from deployment variables instead of hardcoded values.
  • Pins Caddy's upstream reverse_proxy transport keepalive to 30s on the server service, so it stays below the keepAliveTimeout (35s) that nra-server's bootstrapNraApplication now sets (see nra-server#25) — avoids Caddy reusing a keep-alive connection Node already closed.

Test plan

  • Deploy this stack file to a Swarm environment and confirm client/server come up healthy behind Caddy.
  • Confirm MYSQL_HOST/MYSQL_PASSWORD etc. are set correctly in the deployment .env (previously some of these were hardcoded in the live stack file; this version sources them all from env vars like the sibling apps).

Generated by Claude Code

Brings react-admin-nestjs's production Swarm stack in line with
event-management-nra, teacher-report-nra, student-report-nra, and
dnd-management-nra: client/server services, Caddy labels via
caddy-docker-proxy, health checks, and env vars sourced from
deployment variables instead of hardcoded values. Also pins Caddy's
upstream transport keepalive to 30s so it stays below Node's
keepAliveTimeout once nra-server's fix lands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 13, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a production-oriented Docker Swarm stack definition for this repo, aiming to match the deployment conventions used by the sibling NRA apps (separate client/server services, Caddy labels for caddy-docker-proxy, health checks, and env-driven configuration).

Changes:

  • Introduces docker-compose-swarm.yml defining Swarm services for client and server.
  • Configures Caddy routing/health settings via Swarm service labels (including keepalive tuning on the API reverse proxy).
  • Wires deployment-time environment variables into the server (and attempts to for the client).

Comment thread docker-compose-swarm.yml
Comment on lines +6 to +8
container_name: client
depends_on:
- server
Comment thread docker-compose-swarm.yml

server:
image: 'ghcr.io/buzz-code/react-admin-nestjs-server:latest'
container_name: server
Comment thread docker-compose-swarm.yml
retries: 3
environment:
PORT: 80
REACT_APP_API_URL: 'https://api.$DOMAIN_NAME'
Comment thread docker-compose-swarm.yml
labels:
co.elastic.logs/enabled: 'true'
environment:
IP_ADDRESS: $IP_ADDRESS

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used — in server/shared (the nra-server submodule), utils/bootstrap.util.ts builds the CORS allowedOrigins list from process.env.IP_ADDRESS. It's not visible in this repo's diff since the submodule content isn't part of the PR, but the app does read it at runtime. Keeping it.


Generated by Claude Code

claude added 3 commits July 13, 2026 16:01
Picks up the Node keepAliveTimeout/headersTimeout fix (c0cd9fe) and its
CONSUMER_CHANGES.md entry. The corresponding per-app action (Caddy
transport.keepalive labels) is already covered by this branch's
docker-compose-swarm.yml. The other outstanding CONSUMER_CHANGES.md
row (393e9ad, S3Module) was already addressed here previously.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
client/shared -> nra-client@d852588, server/shared -> nra-server@f556912
(includes the merged keepAliveTimeout fix). No app-side consumer action
needed: all rows in both CONSUMER_CHANGES.md tables are already marked
done for this app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Avoids an extra network request on every save, and avoids overwriting
a saved phone number with an empty string if identity hadn't finished
loading when the form's defaultValues were computed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@buzz-code
buzz-code merged commit 8f0d2d6 into main Jul 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants