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