Commit 6eeba650 authored by lizhuo's avatar lizhuo

更新文档

parent e87f05a5
#Introduction # 介绍
It's a repo for quickly setting up the development environment. It uses [Docker 17+](https://www.docker.com) to run containers in swarm mode. 这是帮助你快速启动Spring Cloud开发环境的docker配置仓库.
Below services will be ran by this tool, 这个环境包括如下服务:
- Mongo DB 3.2.9 - Mongo DB 3.4.10
- Redis 3.2 - Redis 3.2
- RabbitMQ 3.6 with `stomp` and `shovel` plugins - RabbitMQ 3.6 with `stomp` and `shovel` plugins
- Spring Cloud
- config-server
- eureka-server
###Prerequisites ## 使用前提
1. Install `Docker` 17.06+ 1. 安装[Docker 17+](https://www.docker.com)
2. Enable Swarm mode of Docker 2. 安装[Docker Compose](https://docs.docker.com/compose/install/#prerequisites)
3. 构建rabbitmq image
###How to set up my development
1. Build custom rabbitmq image,
```shell ```shell
cd rabbitmq cd rabbitmq
./build.sh ./build.sh
``` ```
1. Run below command in shell, 4. 在`docker-compose.yml`里配置config-server的配置文件仓库
```shell
docker stack deploy -c docker-stack.yml mydev ## 使用方式
``` ### 启动 `docker-compose up -d`
eureka-server需要等待config-server成功启动才能起来,而目前两个服务时同时起的,
所以**间隔几秒后需要执行第二次命令**。
###Note ### 销毁环境 `docker-compose down`
By default, the script does not mount the storage of services as external storage. It means the data in MongoDB/Redis/RabbitMQ will be lost after recreating the services/underly containers.
### 查看服务运行情况参考`docker-compose help`
## 运行数据
默认情况下,环境销毁后数据会丢失,使用下面的方法可以把数据保存在本地
If you want to persistly save your data, you can create named volume like below,
```shell ```shell
docker volume create --opt type=none --opt device=<absolute path of host> --opt o=bind --name mongo_data docker volume create --opt type=none --opt device=<absolute path of host> --opt o=bind --name mongo_data
``` ```
...@@ -35,4 +41,4 @@ volumes: ...@@ -35,4 +41,4 @@ volumes:
redis_data: redis_data:
mongo_data: mongo_data:
external: true external: true
``` ```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment