Repository navigation
Add docker-compose-swarm.yml aligned with sibling NRA apps - #110
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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.ymldefining Swarm services forclientandserver. - 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 theclient).
Comment on lines
+6
to
+8
| container_name: client | ||
| depends_on: | ||
| - server |
|
|
||
| server: | ||
| image: 'ghcr.io/buzz-code/react-admin-nestjs-server:latest' | ||
| container_name: server |
| retries: 3 | ||
| environment: | ||
| PORT: 80 | ||
| REACT_APP_API_URL: 'https://api.$DOMAIN_NAME' |
| labels: | ||
| co.elastic.logs/enabled: 'true' | ||
| environment: | ||
| IP_ADDRESS: $IP_ADDRESS |
Owner
Author
There was a problem hiding this comment.
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docker-compose-swarm.yml, bringing react-admin-nestjs's production Swarm stack in line withevent-management-nra,teacher-report-nra,student-report-nra, anddnd-management-nra:client/serverservices, Caddy labels viacaddy-docker-proxy, health checks, and env vars sourced from deployment variables instead of hardcoded values.reverse_proxytransportkeepaliveto 30s on theserverservice, so it stays below thekeepAliveTimeout(35s) thatnra-server'sbootstrapNraApplicationnow sets (see nra-server#25) — avoids Caddy reusing a keep-alive connection Node already closed.Test plan
client/servercome up healthy behind Caddy.MYSQL_HOST/MYSQL_PASSWORDetc. 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