Skip to content

Conversation

@craig8
Copy link
Contributor

@craig8 craig8 commented Nov 18, 2025

…' commands

@craig8 craig8 requested a review from Copilot November 18, 2025 01:54
Copilot finished reviewing on behalf of craig8 November 18, 2025 01:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Docker Compose-related scripts to support both the newer docker compose command (built into Docker) and the older standalone docker-compose command, improving compatibility across different Docker installation versions.

Key Changes:

  • Added automatic detection logic to identify and use the available Docker Compose command variant
  • Updated all Docker Compose command invocations to use the dynamically detected command
  • Enhanced error handling with clear messages when neither command is found

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
stop.sh Added detect_docker_compose() function and updated all docker-compose command calls to use the detected variant
run.sh Added detect_docker_compose() function, updated all command calls, and improved container ID detection logic with fallback handling
docker-compose.yml Removed trailing whitespace and added ulimits configuration for blazegraph service
.gitignore Added *.log pattern to ignore log files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +12
# Detect docker compose command (newer 'docker compose' vs older 'docker-compose')
detect_docker_compose() {
if docker compose version &>/dev/null; then
echo "docker compose"
elif docker-compose --version &>/dev/null; then
echo "docker-compose"
else
echo ""
fi
}
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detect_docker_compose function is duplicated identically in both run.sh and stop.sh. Consider extracting this common functionality into a shared utility script (e.g., docker-compose-utils.sh) that can be sourced by both scripts. This would improve maintainability and ensure consistency if the detection logic needs to be updated in the future.

Example:

# In docker-compose-utils.sh
detect_docker_compose() {
  if docker compose version &>/dev/null; then
    echo "docker compose"
  elif docker-compose --version &>/dev/null; then
    echo "docker-compose"
  else
    echo ""
  fi
}

# In run.sh and stop.sh
source ./docker-compose-utils.sh
Suggested change
# Detect docker compose command (newer 'docker compose' vs older 'docker-compose')
detect_docker_compose() {
if docker compose version &>/dev/null; then
echo "docker compose"
elif docker-compose --version &>/dev/null; then
echo "docker-compose"
else
echo ""
fi
}
# Source shared docker compose utility functions
source ./docker-compose-utils.sh

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +34
ulimits:
nofile:
soft: 65536
hard: 65536
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The addition of ulimits configuration for the blazegraph service appears to be unrelated to the stated purpose of this PR (refactoring scripts to support both 'docker compose' and 'docker-compose' commands). Consider moving this infrastructure change to a separate PR for better change tracking and review focus.

Suggested change
ulimits:
nofile:
soft: 65536
hard: 65536

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants