Update Dockerfile to enhance TypeScript configuration with JSX support, install wget for health checks, and improve healthcheck command compatibility.
This commit is contained in:
64
DEPLOYMENT_FIXES.md
Normal file
64
DEPLOYMENT_FIXES.md
Normal file
@ -0,0 +1,64 @@
|
||||
# 🔧 Deployment Issue Fixes
|
||||
|
||||
## 🔍 Issues Identified from Latest Log
|
||||
|
||||
### **Issue 1: TypeScript JSX Configuration Missing** ❌→✅
|
||||
**Problem**: TypeScript compilation failing with `error TS6142: '--jsx' is not set`
|
||||
**Root Cause**: Generated tsconfig.json in Docker was missing JSX configuration
|
||||
**Fix Applied**: Added `"jsx":"react-jsx"` to the tsconfig.json generation in Dockerfile
|
||||
**Line Fixed**: Line 77 in Dockerfile
|
||||
|
||||
### **Issue 2: Health Check Tool Mismatch** ❌→✅
|
||||
**Problem**: Health checks failing with `wget: can't connect to remote host: Connection refused`
|
||||
**Root Cause**:
|
||||
- Dockerfile uses `curl` for health checks
|
||||
- Coolify deployment system uses `wget` for health checks
|
||||
- Tool mismatch causing health check failures
|
||||
|
||||
**Fix Applied**:
|
||||
1. Added `wget` installation alongside `curl`
|
||||
2. Updated health check command to support both tools: `curl -f http://localhost/ || wget -q --spider http://localhost/ || exit 1`
|
||||
|
||||
### **Issue 3: Container Health Check Endpoint** ❌→✅
|
||||
**Problem**: Health check trying to access `/health` endpoint that doesn't exist
|
||||
**Fix Applied**: Changed health check to use root path `/` which always exists for Nginx
|
||||
|
||||
## 📋 Changes Made
|
||||
|
||||
### **1. Updated Dockerfile (Lines 77, 89, 113)**
|
||||
```dockerfile
|
||||
# Fixed TypeScript JSX configuration
|
||||
RUN echo '{"compilerOptions":{..."jsx":"react-jsx"...}}' > tsconfig.json
|
||||
|
||||
# Added wget for Coolify compatibility
|
||||
RUN apk add --no-cache curl wget
|
||||
|
||||
# Fixed health check with fallback
|
||||
CMD curl -f http://localhost/ || wget -q --spider http://localhost/ || exit 1
|
||||
```
|
||||
|
||||
## ✅ Expected Results
|
||||
|
||||
After these fixes:
|
||||
|
||||
1. **TypeScript Build**: ✅ Should compile `.tsx` files successfully
|
||||
2. **Health Check**: ✅ Should pass using either curl or wget
|
||||
3. **Container Status**: ✅ Should show as healthy
|
||||
4. **Deployment**: ✅ Should complete without rollback
|
||||
|
||||
## 🎯 Root Cause Analysis
|
||||
|
||||
The deployment failures were caused by:
|
||||
1. **Build Configuration**: Missing JSX support in generated TypeScript config
|
||||
2. **Health Check Compatibility**: Tool mismatch between Docker image and deployment platform
|
||||
3. **Endpoint Mismatch**: Health check looking for non-existent endpoint
|
||||
|
||||
## 🚀 Next Deployment
|
||||
|
||||
The next deployment should:
|
||||
- ✅ Build successfully with JSX support
|
||||
- ✅ Pass health checks with both curl and wget
|
||||
- ✅ Complete without rollbacks
|
||||
- ✅ Result in a fully functional application
|
||||
|
||||
**Status**: Ready for redeployment with fixes applied! 🎉
|
Reference in New Issue
Block a user