Sparrow is a Docker tool for one-click startup of multiple services and environments.
This project relies entirely on Docker, so Docker must be installed and running.
This project offers two different installation methods: development version and release version. The differences between the two are as follows. Please choose according to your needs:
- Development version: The project updates at a high frequency, so the features and functionalities are always up-to-date! However, there may be some bugs that cannot be avoided, and 100% stability cannot be guaranteed.
- Release version: A version of the project released at a certain point in time, which has undergone multi-level testing and has been running stably for a period of time. You can view various release versions here.
If it's the first time, you can use the following commands to install.
# get project
git clone https://github.com/WGrape/sparrow.git
cd sparrow
# install
bash _install.sh
# usage help
./sparrow --help
After installation, if you need to update to the latest development version, execute the following command to begin the update.
bash _update.sh
If you need a specific version of the release package, please click here to download, and then follow these steps.
cd sparrow
# install
bash _install.sh
# usage help
./sparrow --help
Please note that the release package does not support updates! So after installing a specific version of the release package, please do not execute the bash _update.sh
command.
Use the following command to start all services in the entire environment. Of course, this all services
can be defined and is controlled by the ENABLE_SERVICE_LIST
array variable configured in the /.env
file in the root directory.
./sparrow start
If you only need to start a specific service, you can use the following command. The service
passed in is the name of a service in the services
list in the docker-compose.yml
configuration file, such as phpfpm/nginx/mysql/redis
, etc.
./sparrow startone {service_name}
Use the following command, if nothing wrong output, it means the installation is successful.
bash .work/test/run.sh
Stop all services in the entire environment
./sparrow stop
Restart all services in the entire environment
./sparrow restart
When the content of the image needs to be modified to support new requirements, the services need to be updated, which is actually updating the image.
./sparrow updateone {service}
When we need to adjust the Go version to 1.17.0
(default is 1.21.1), follow these steps:
- First, modify the official image: change
IMAGE_OFFICIAL_GO_VERSION=1.21.1
in the/.env
file toIMAGE_OFFICIAL_GO_VERSION=1.17.0
. - Then, modify the basic image: change
IMAGE_BASIC_GO_VERSION=1.21.1
in the/.env
file toIMAGE_BASIC_GO_VERSION=1.17.0
. - Finally, update the go service: execute
./sparrow updateone go
.
More examples and explain,please check How to update a service doc.
If you need to view the running status of sparrow and the container information of the allowed services, you can use the following command.
./sparrow status
![](https://private-user-images.githubusercontent.com/35942268/309755267-ac5dfe91-6f8c-47ea-9182-55119da1ccaf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1MDIxMjMsIm5iZiI6MTcxODUwMTgyMywicGF0aCI6Ii8zNTk0MjI2OC8zMDk3NTUyNjctYWM1ZGZlOTEtNmY4Yy00N2VhLTkxODItNTUxMTlkYTFjY2FmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE2VDAxMzcwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTljZDhmODRkZjk4NDY4N2ZhM2Q4NWZmNTA1NmI0ODAxZTI4MDgxMDMzY2MwNDE0MzVkZjA1MTIyMTM0NzUwOWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zXlwb92wmV8DRbGqMyBZbfldcsbH3taKapfzfM7Fugs)