Open adnanhashmi09 opened 1 month ago
So regarding this issue, I'd like to confirm a few things:
docker compose down
command in dev.sh script itself? Because otherwise, we would get the error "Cannot connect to the Docker daemon at unix:///home/solo/.docker/desktop/docker.sock. Is the docker daemon running?
", and then the script would proceed to run the yarn start
command in the cli folder. I think that if we add the daemon check in the app.tsx
file then this message would still appear and potentially be confusing.For the ports, I believe these are the only ones that are used (found in the dockerfile). Please let me know if I'm missing anything:
Well, these ports can be changed using the environment variables. The ports specified in the Dockerfile
are the default values in case the ports are not specified in the environment variables. You would have to get the ports from the environment for each of the above service, ie, DB_PORT
, REDIS_PORT
, PORT
, ANALYTICS_SERVER_PORT
and SYNC_SERVER_PORT
, and then check if these ports are available to be used.
For checking if docker daemon is running, should we do it before we call the docker compose down command in dev.sh script itself? Because otherwise, we would get the error "Cannot connect to the Docker daemon at unix:///home/solo/.docker/desktop/docker.sock. Is the docker daemon running?", and then the script would proceed to run the yarn start command in the cli folder. I think that if we add the daemon check in the app.tsx file then this message would still appear and potentially be confusing.
Oh! You are actually right about that. Good thinking!
How about we move that to the cli itself, instead of running it inside the bash file. So what I mean is, we first do the pre-requisite checks that I have specified in the issue description and then do docker compose down
in the cli. And then the cli proceeds to function the way it does. So we remove docker compose down
from the bash script. Thank you @sidtohan for pointing this out.
Also, do remember you would have to make appropriate changes in the UI as well. When the pre-requisite checks are running display a spinner and when they are successful update those spinners to a check-mark or a cross. Something like below:
(PS: Please don't use the above screenshots as a design reference for the UI. That is just an example illustration)
Thanks for the help @adnanhashmi09 . I think I have more clarity on this now. Could I please be assigned this issue?
Sure :)
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:
docker-compose.yml
file exists in the project directoryDockerfile.dev
exists in the project directoryImplementation Steps:
docker-compose.yml
file exists in the project directory.Dockerfile.dev
exists in the project directory.docker-compose watch
command only if all pre-requisite checks pass.Additional Considerations: