middleware icon indicating copy to clipboard operation
middleware copied to clipboard

Add pre-requisite checks for the CLI tool

Open adnanhashmi09 opened this issue 9 months ago • 0 comments

Description:

Before running the docker-compose watch command to set up the development environment, we should add some pre-requisite checks to ensure that the necessary components are available and the required files exist. This will help catch potential issues early and provide a better user experience.

Pre-requisite Checks:

  • [ ] Check if the required ports are available (list the specific ports needed)
  • [ ] Check if the Docker daemon is running
  • [ ] Check if the docker-compose.yml file exists in the project directory
  • [ ] Check if the Dockerfile.dev exists in the project directory

Implementation Steps:

  1. Identify the required ports for the development environment and add a check to ensure they are not already in use.
  2. Add a check to verify if the Docker daemon is running on the system.
  3. Add a check to ensure that the docker-compose.yml file exists in the project directory.
  4. Add a check to ensure that the Dockerfile.dev exists in the project directory.
  5. Display appropriate error messages or prompts if any of the pre-requisite checks fail.
  6. Proceed with the docker-compose watch command only if all pre-requisite checks pass.

Additional Considerations:

  • Handle different operating systems (e.g., Linux, macOS, Windows) for checking the Docker daemon status.
  • Provide clear instructions or guidance if any of the pre-requisite checks fail, such as suggesting solutions or troubleshooting steps.
  • Consider adding unit tests for the pre-requisite check functions.

adnanhashmi09 avatar May 09 '24 18:05 adnanhashmi09