joyent-portal/docker-compose.yml

100 lines
3.0 KiB
YAML

#############################################################################
# CONSUL
#
# Consul is the service catalog that helps discovery between the components
# Change "-bootstrap" to "-bootstrap-expect 3", then scale to 3 or more to
# turn this into an HA Consul raft.
#############################################################################
consul:
image: autopilotpattern/consul:latest
command: >
/usr/local/bin/containerpilot
/bin/consul agent -server
-bootstrap-expect 3
-config-dir=/etc/consul
-ui-dir /ui
restart: always
mem_limit: 128m
env_file: .env
ports:
- 8500
dns:
- 127.0.0.1
labels:
- triton.cns.services=consul
- com.docker.swarm.affinities=["container!=~*"]
#############################################################################
# CloudAPI GraphQL
#############################################################################
cloudapi:
image: quay.io/yldio/joyent-dashboard-cloudapi-graphql:latest
mem_limit: 128m
labels:
- triton.cns.services=cloudapi
- com.docker.swarm.affinities=["container!=~*cloudapi*"]
env_file: .env
environment:
- CONSUL_AGENT=1
- PORT=3000
ports:
- 3000:3000
#############################################################################
# Frontend
#############################################################################
frontend:
image: quay.io/yldio/joyent-dashboard-frontend:latest
mem_limit: 512m
labels:
- triton.cns.services=frontend
- com.docker.swarm.affinities=["container!=~*frontend*"]
env_file: .env
environment:
- CONSUL_AGENT=1
- PORT=8000
ports:
- 8000:8000
#############################################################################
# UI
#############################################################################
ui:
image: quay.io/yldio/joyent-dashboard-ui:latest
mem_limit: 512m
labels:
- triton.cns.services=ui
- com.docker.swarm.affinities=["container!=~*ui*"]
env_file: .env
environment:
- CONSUL_AGENT=1
- PORT=8080
#############################################################################
# Nginx as a load-balancing tier and reverse proxy
#############################################################################
nginx:
image: quay.io/yldio/joyent-portal-nginx
restart: always
mem_limit: 256m
ports:
- 80:80
- 443:443
- 9090:9090
env_file: .env
environment:
- CONSUL_AGENT=1
labels:
- triton.cns.services=nginx
- com.docker.swarm.affinities=["container!=~*nginx*"]
#############################################################################
# Prometheus is an open source performance monitoring tool
# it is included here for demo purposes and is not required
#############################################################################
prometheus:
image: autopilotpattern/prometheus:latest
restart: always
mem_limit: 1g
env_file: .env
ports:
- 9090
labels:
- triton.cns.services=prometheus
- com.docker.swarm.affinities=["container!=~*prometheus*"]