middleware
middleware copied to clipboard
Add pre-requisite checks for the CLI tool
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:
- Identify the required ports for the development environment and add a check to ensure they are not already in use.
- Add a check to verify if the Docker daemon is running on the system.
- Add a check to ensure that the
docker-compose.yml
file exists in the project directory. - Add a check to ensure that the
Dockerfile.dev
exists in the project directory. - Display appropriate error messages or prompts if any of the pre-requisite checks fail.
- 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.