Skip to content

Instantly share code, notes, and snippets.

@akurkin
Last active March 10, 2017 13:24
Show Gist options
  • Save akurkin/1d43fb03c6f415093bab to your computer and use it in GitHub Desktop.
Save akurkin/1d43fb03c6f415093bab to your computer and use it in GitHub Desktop.
ROSI docker-compose.yml
#
# Shared definition of ruby microservice
#
microservice:
command: "runsvdir /etc/service"
environment:
PORT: 3000
RAILS_ENV: development
SERVICE_PLATFORM: "mia"
ports:
- 3000
#
# Shared definition of frontend js client
#
frontend:
environment:
SERVICE_PLATFORM: "mia"
ports:
- 80
#
# Load Balancer
#
lb:
build: ./lb/
links:
- consul
ports:
- "80:80"
- "8181:8181"
#
# Service Discovery - Consul
#
consul:
command: -server -bootstrap -advertise 10.0.2.15
image: progrium/consul:latest
ports:
- "8300:8300"
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
#
# Service Discovery - Registrator
#
registrator:
command: -ip=10.0.2.15 consul://consul:8500
image: gliderlabs/registrator:latest
links:
- consul
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
#
# Data-only container for rubygems
#
rubygems:
image: "busybox"
volumes:
- /web/rubygems/2.0.0-p643
data:
image: "busybox"
volumes:
- /var/lib/mysql
#
# Infrastructure
#
db:
image: "mysql:latest"
environment:
MYSQL_ROOT_PASSWORD: root
volumes_from:
- data
memcache:
image: "sylvainlasnier/memcached:latest"
rmq:
image: "rabbitmq:management"
hostname: "rmq"
ports:
- '15672:15672'
elastic:
image: "elasticsearch:latest"
#
# Microservices
#
user:
extends:
file: common.yml
service: microservice
build: ./services/rosi_user_service
environment:
SERVICE_3000_NAME: "user"
SERVICE_3000_TAGS: "backend,user"
volumes:
- ./services/rosi_user_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
- elastic
catalog:
extends:
file: common.yml
service: microservice
build: ./services/rosi_catalog_service
environment:
SERVICE_3000_NAME: "catalog"
SERVICE_3000_TAGS: "backend,catalog"
volumes:
- ./services/rosi_catalog_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
- elastic
cart:
extends:
file: common.yml
service: microservice
build: ./services/rosi_cart_service
environment:
SERVICE_3000_NAME: "cart"
SERVICE_3000_TAGS: "backend,cart"
volumes:
- ./services/rosi_cart_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
mybusiness:
extends:
file: common.yml
service: microservice
build: ./services/rosi_my_business_service
environment:
SERVICE_3000_NAME: "mybusiness"
SERVICE_3000_TAGS: "backend,mybusiness"
volumes:
- ./services/rosi_my_business_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
- elastic
inventory:
extends:
file: common.yml
service: microservice
build: ./services/rosi_inventory_service
command: "runsvdir /etc/service"
environment:
SERVICE_3000_NAME: "inventory"
SERVICE_3000_TAGS: "backend,inventory"
volumes:
- ./services/rosi_inventory_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
oms:
extends:
file: common.yml
service: microservice
build: ./services/rosi_oms_service
command: "runsvdir /etc/service"
environment:
SERVICE_3000_NAME: "oms"
SERVICE_3000_TAGS: "backend,oms"
volumes:
- ./services/rosi_oms_service:/web/service
volumes_from:
- rubygems
links:
- db
- memcache
- rmq
- consul
- elastic
tax:
extends:
file: common.yml
service: microservice
build: ./services/rosi_tax_service
command: "runsvdir /etc/service"
environment:
SERVICE_3000_NAME: "tax"
SERVICE_3000_TAGS: "backend,tax"
volumes:
- ./services/rosi_tax_service:/web/service
volumes_from:
- rubygems
links:
- rmq
- consul
#
# Frontend
#
keeplounge:
extends:
file: common.yml
service: frontend
build: ./frontend/keep_lounge
environment:
SERVICE_80_NAME: "keeplounge"
SERVICE_80_TAGS: "frontend,keep,keeplounge"
volumes:
- ./frontend/keep_lounge:/web/client
keepwww:
extends:
file: common.yml
service: frontend
build: ./frontend/keep_www
environment:
SERVICE_80_NAME: "keepwww"
SERVICE_80_TAGS: "frontend,keep,keepwww"
volumes:
- ./frontend/keep_www:/web/client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment