3.7 KiB
3.7 KiB
Dokploy Troubleshooting Guide
Current Configuration
- Application Port: 5173 (to avoid conflict with your existing app on port 3000)
- Container Port: 5173
- Health Check: http://localhost:5173/health
Common Issues and Solutions
1. 404 Page Not Found
Possible Causes:
- Port mapping issue
- Application not starting properly
- Dokploy routing configuration
Solutions:
A. Check Dokploy Port Configuration
In Dokploy, make sure:
- Go to your application settings
- Check "Port" or "Exposed Port" is set to 5173
- If there's a "Target Port" field, set it to 5173 as well
B. Check Application Logs
- In Dokploy, go to your application
- Click "Logs" tab
- Look for:
[remix-serve] http://localhost:5173 - If you see port 3000 instead, there's a configuration issue
C. Verify Environment Variables
Make sure these are set in Dokploy environment variables:
NODE_ENV=production
PORT=5173
SESSION_SECRET=your-secure-secret
SUPER_ADMIN=superadmin
SUPER_ADMIN_EMAIL=admin@yourcompany.com
SUPER_ADMIN_PASSWORD=YourSecurePassword123!
2. Application Starts but Shows Wrong Port in Logs
If logs show http://localhost:3000 instead of 5173:
-
Check Dokploy Environment Variables:
- Ensure
PORT=5173is set - Remove any conflicting port variables
- Ensure
-
Redeploy the application after fixing environment variables
3. Health Check Failures
If health checks are failing:
-
Manual Health Check:
# SSH into your server and run: docker exec -it phosphat-report-app wget -qO- http://localhost:5173/health -
Expected Response:
{ "status": "ok", "timestamp": "2025-07-24T...", "uptime": 123.45, "environment": "production", "database": "connected" }
4. Database Issues
If you see database connection errors:
-
Check Database Path:
- Ensure
DATABASE_URL=file:/app/data/production.db - Check if
/app/datadirectory has proper permissions
- Ensure
-
Reset Database (if needed):
# Stop application in Dokploy # SSH into server and run: docker volume rm $(docker volume ls -q | grep app_data) # Restart application in Dokploy
Access Your Application
Once deployed successfully:
Direct Access
- URL:
http://your-server-ip:5173 - Login: Use the credentials from
SUPER_ADMIN_EMAILandSUPER_ADMIN_PASSWORD
Through Reverse Proxy (if configured)
- URL:
https://your-domain.com - Make sure your reverse proxy (nginx/traefik) is configured to forward to port 5173
Dokploy-Specific Configuration
Environment Variables to Set in Dokploy UI:
NODE_ENV=production
PORT=5173
DATABASE_URL=file:/app/data/production.db
SESSION_SECRET=your-super-secure-session-secret-min-32-chars
SUPER_ADMIN=superadmin
SUPER_ADMIN_EMAIL=admin@yourcompany.com
SUPER_ADMIN_PASSWORD=YourSecurePassword123!
Port Configuration:
- Container Port: 5173
- Host Port: 5173 (or any available port you prefer)
Quick Deployment Checklist
- Repository URL is correct
- Branch is set to
main - Environment variables are set
- Port is configured as 5173
- Build completed successfully
- Container is running
- Health check passes
- Application is accessible at
http://server-ip:5173
Still Having Issues?
-
Check Container Status:
docker ps | grep phosphat-report -
View Real-time Logs:
docker logs -f phosphat-report-app -
Test Health Endpoint:
curl http://localhost:5173/health -
Check Port Binding:
netstat -tlnp | grep 5173
If none of these solutions work, the issue might be with Dokploy's internal routing or your server's firewall configuration.