🔧 Fix All Docker Compose Commands
✅ Updated All Docker Compose References: - package.json: docker:compose and docker:down scripts - scripts/deploy.sh: All compose commands and checks - scripts/monitor.sh: All compose commands - DEPLOYMENT.md: Documentation examples - .github/workflows/ci-cd.yml: CI/CD pipeline �� Benefits: - Compatible with newer Docker versions (docker compose) - No more 'command not found' errors - Consistent syntax across all files - Successful deployment and monitoring 📝 Changed: - 'docker-compose' → 'docker compose' (new syntax) - Updated command availability checks - Fixed all script references
This commit is contained in:
@@ -48,9 +48,9 @@ if ! docker info > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if docker-compose is available
|
||||
if ! command -v docker-compose &> /dev/null; then
|
||||
error "docker-compose is not installed. Please install docker-compose and try again."
|
||||
# Check if docker compose is available
|
||||
if ! docker compose version &> /dev/null; then
|
||||
error "docker compose is not available. Please ensure Docker is installed and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -88,7 +88,7 @@ docker pull $FULL_IMAGE_NAME || {
|
||||
|
||||
# Stop and remove old containers
|
||||
log "Stopping old containers..."
|
||||
docker-compose -f $COMPOSE_FILE down || {
|
||||
docker compose -f $COMPOSE_FILE down || {
|
||||
warning "No old containers to stop"
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ docker images $REGISTRY/$IMAGE_NAME --format "table {{.Tag}}\t{{.ID}}" | tail -n
|
||||
|
||||
# Start new containers
|
||||
log "Starting new containers..."
|
||||
docker-compose -f $COMPOSE_FILE up -d || {
|
||||
docker compose -f $COMPOSE_FILE up -d || {
|
||||
error "Failed to start containers"
|
||||
exit 1
|
||||
}
|
||||
@@ -125,7 +125,7 @@ done
|
||||
if [ $ELAPSED -ge $HEALTH_CHECK_TIMEOUT ]; then
|
||||
error "Health check timeout. Application may not be running properly."
|
||||
log "Container logs:"
|
||||
docker-compose -f $COMPOSE_FILE logs --tail=50
|
||||
docker compose -f $COMPOSE_FILE logs --tail=50
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -136,7 +136,7 @@ if curl -f http://localhost:3000/api/health > /dev/null 2>&1; then
|
||||
|
||||
# Show container status
|
||||
log "Container status:"
|
||||
docker-compose -f $COMPOSE_FILE ps
|
||||
docker compose -f $COMPOSE_FILE ps
|
||||
|
||||
# Show resource usage
|
||||
log "Resource usage:"
|
||||
@@ -145,7 +145,7 @@ if curl -f http://localhost:3000/api/health > /dev/null 2>&1; then
|
||||
else
|
||||
error "Deployment verification failed!"
|
||||
log "Container logs:"
|
||||
docker-compose -f $COMPOSE_FILE logs --tail=50
|
||||
docker compose -f $COMPOSE_FILE logs --tail=50
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user