Commit 4ea1720e authored by 朱孟欣(已离职)'s avatar 朱孟欣(已离职)

Update stack ymal and doc.

parent 158a092f
...@@ -5,17 +5,21 @@ Below services will be ran by this tool, ...@@ -5,17 +5,21 @@ Below services will be ran by this tool,
- Mongo DB 3.2.9 - Mongo DB 3.2.9
- Redis 3.2 - Redis 3.2
- RabbitMQ 3.6 - RabbitMQ 3.6 with `stomp` and `shovel` plugins
###Prerequisites ###Prerequisites
1. Install `Docker` 17.3+ 1. Install `Docker` 17.06+
2. Enable Swarm mode of Docker 2. Enable Swarm mode of Docker
###How to set up my development ###How to set up my development
1. Update the ports of local service in `dev.env` if necessary 1. Build custom rabbitmq image,
2. Run below command in shell,
```shell ```shell
docker stack deploy -c docker-compose.yml mydev cd rabbitmq
./build.sh
```
1. Run below command in shell,
```shell
docker stack deploy -c docker-stack.yml mydev
``` ```
###Note ###Note
...@@ -25,7 +29,7 @@ If you want to persistly save your data, you can create named volume like below, ...@@ -25,7 +29,7 @@ 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
``` ```
Update `docker-compose.yml` as below, Update `docker-stack.yml` as below,
```shell ```shell
volumes: volumes:
redis_data: redis_data:
......
MONGO_PORT=27017
REDIS_PORT=6379
RABBITMQ_PORT=5672
RABBITMQMG_PORT=15672
\ No newline at end of file
version: "3" version: "3.3"
services: services:
mongo: mongo:
image: mongo:3.2.9 image: mongo:3.2.9
ports: ports:
- "${MONGO_PORT}:27017" - "27017:27017"
networks: networks:
- pilipa-dev - pilipa-dev
env_file:
- ./dev.env
volumes: volumes:
- mongo_data:/data/db - mongo_data:/data/db
redis: redis:
...@@ -15,21 +13,18 @@ services: ...@@ -15,21 +13,18 @@ services:
networks: networks:
- pilipa-dev - pilipa-dev
ports: ports:
- "${REDIS_PORT}:6379" - "6379:6379"
env_file:
- ./dev.env
volumes: volumes:
- redis_data:/data - redis_data:/data
rabbit: rabbit:
image: rabbitmq:3.6-management-alpine image: pilipa/rabbitmq:3.6.10-management-alpine
hostname: rabbit hostname: rabbit
ports: ports:
- "${RABBITMQ_PORT}:5672" - "5672:5672"
- "${RABBITMQMG_PORT}:15672" - "15672:15672"
- "61613:61613"
networks: networks:
- pilipa-dev - pilipa-dev
env_file:
- ./dev.env
environment: environment:
- RABBITMQ_DEFAULT_VHOST=pilipa - RABBITMQ_DEFAULT_VHOST=pilipa
...@@ -40,4 +35,3 @@ networks: ...@@ -40,4 +35,3 @@ networks:
volumes: volumes:
redis_data: redis_data:
mongo_data: mongo_data:
# external: true
FROM rabbitmq:3.6.10-management-alpine
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.5/main" >/etc/apk/repositories \
&& echo "http://mirrors.aliyun.com/alpine/v3.5/community" >>/etc/apk/repositories \
&& apk add --no-cache --update su-exec \
&& rm -rf /var/cache/apk/* \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone
RUN rabbitmq-plugins enable --offline rabbitmq_shovel rabbitmq_shovel_management rabbitmq_web_stomp
docker build -t pilipa/rabbitmq:3.6.10-management-alpine .
\ 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