Features:
- Health endpoint now returns git_commit SHA and version
- Auto-detects git commit during Docker build
- Falls back to 'unknown' if git info unavailable
- Allows AI agents to verify deployed version
Changes:
1. server.js: Add git_commit and version to /health response
2. Dockerfile: Add git installation and commit detection
3. Dockerfile: Accept GIT_COMMIT and APP_VERSION build args
4. docker-compose.yml: Pass build args and env vars for versioning
5. README.md: Document version tracking in health endpoint
Example response:
{
"status": "healthy",
"postgres": "connected",
"redis": "connected",
"timestamp": "2026-02-14T10:30:00.000Z",
"git_commit": "eb6b6e0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q",
"version": "1.0.0"
}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Critical changes for production stability:
1. Add healthchecks to all services:
- app: curl to /health endpoint (10s interval, 5s start period)
- postgres: pg_isready check (5s interval)
- redis: redis-cli ping check (5s interval)
2. Use depends_on with health conditions:
- Ensures postgres/redis are fully ready before app starts
- Prevents connection errors during startup
3. Remove hardcoded container_name:
- Prevents name collisions between deployments
- Allows Coolify to manage container names
Why this matters:
- Without healthchecks: Coolify kills old container → builds new → 502 gap
- With healthchecks: Coolify builds new → waits for healthy → kills old → zero downtime
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Node.js Express application with modern white UI
- PostgreSQL and Redis integration
- Docker Compose configuration without host port mappings
- Traefik-ready with proper labels
- Health check endpoint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>