-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-docker-build.sh
More file actions
executable file
·42 lines (32 loc) · 1.04 KB
/
Copy pathtest-docker-build.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Test script to verify Docker build works locally
# This helps ensure the deployment will work on Render
echo "Testing Docker build for RCA Backend..."
# Build the Docker image
echo "Building Docker image..."
docker build -t rca-backend-test .
if [ $? -eq 0 ]; then
echo "✅ Docker build successful!"
# Test running the container
echo "Testing container startup..."
docker run --rm -d --name rca-test -p 8080:8080 rca-backend-test
# Wait a moment for startup
sleep 5
# Test health endpoint
echo "Testing health endpoint..."
curl -f http://localhost:8080/health
if [ $? -eq 0 ]; then
echo "✅ Health check passed!"
else
echo "❌ Health check failed!"
fi
# Clean up
docker stop rca-test
docker rmi rca-backend-test
echo "✅ Docker test completed successfully!"
echo "Your application is ready for Render deployment!"
else
echo "❌ Docker build failed!"
echo "Please check the build logs above for errors."
exit 1
fi