microservices
microservices copied to clipboard
development: Commands CLI
Proposal
Create a CLI for handling the microservices environment state
Why we need this
To create this environment, you need to:
- Create a directory.
cd directorygit initgit submodule add https://github.com/armand1m/microservices-compose-utils ./commandsgit submodule add https://github.com/armand1m/core-services.- Create a
docker-compose.ymlfile with this content:
version: '2'
services:
consul:
extends:
file: ./core-services/services.yml
service: consul_service
gateway:
extends:
file: ./core-services/services.yml
service: fabio_service
links:
- consul
To add a service to the recently created environment, you need to:
git clone https://github.com/armand1m/microservice-barebone ./my-servicecd ./my-servicegit submodule add https://github.com/<user>/<service-name>- Edit the
docker-compose.ymlto extend and run the added service. Let's say you are addingarmand1m/bucket-service. The file would look like this after the modifications:
service:
extends:
file: ./bucket-service/service.yml
service: service
volumes:
- ./data:/data
depends_on:
- consul
links:
- consul
consul:
extends:
file: ./core-services/services.yml
service: consul_service
gateway:
extends:
file: ./core-services/services.yml
service: fabio_service
links:
- consul