Commit 5bcb76f5 authored by 朱孟欣(已离职)'s avatar 朱孟欣(已离职)

Initial version of infrastructure repo.

parents
#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.
Below services will be ran by this tool,
- Mongo DB 3.4
- Redis 3.2
- RabbitMQ 3.6
###Prerequisites
1. Install `Docker` 17.3+
2. Enable Swarm mode of Docker
###How to set up my development
1. Update the ports of local service in `dev.env` if necessary
2. Run below command in shell,
```
docker stack deploy -c docker-compose.yml mydev
```
###Note
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.
If you want to persistly save your data, you can create named volume like below,
```
docker volume create --opt type=none --opt device=<absolute path of host> --opt o=bind --name mongo_data
```
Update `docker-compose.yml` as below,
```
volumes:
rabbitmq_data:
redis_data:
mongo_data:
external: true
```
\ No newline at end of file
MONGO_PORT=27017
REDIS_PORT=6379
RABBITMQ_PORT=5672
RABBITMQMG_PORT=15672
\ No newline at end of file
version: "3"
services:
mongo:
image: mongo:3.4
ports:
- "${MONGO_PORT}:27017"
networks:
- pilipa-dev
env_file:
- ./dev.env
volumes:
- mongo_data:/data/db
redis:
image: redis:3.2-alpine
networks:
- pilipa-dev
ports:
- "${REDIS_PORT}:6379"
env_file:
- ./dev.env
volumes:
- redis_data:/data
rabbit:
image: rabbitmq:3.6-management-alpine
hostname: rabbit
ports:
- "${RABBITMQ_PORT}:5672"
- "${RABBITMQMG_PORT}:15672"
networks:
- pilipa-dev
env_file:
- ./dev.env
environment:
- RABBITMQ_DEFAULT_VHOST=pilipa
networks:
pilipa-dev:
driver: overlay
volumes:
redis_data:
mongo_data:
# 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