2017-05-30 21:04:51 +03:00
|
|
|
#############################################################################
|
|
|
|
# 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:
|
2017-08-03 00:56:53 +03:00
|
|
|
image: autopilotpattern/consul:0.7.2-r0.8
|
2017-05-30 21:04:51 +03:00
|
|
|
command: >
|
|
|
|
/usr/local/bin/containerpilot
|
|
|
|
/bin/consul agent -server
|
2017-08-03 00:56:53 +03:00
|
|
|
-config-dir=/etc/consul
|
|
|
|
-log-level=err
|
|
|
|
-bootstrap-expect 1
|
|
|
|
-ui-dir /ui
|
2017-05-30 21:04:51 +03:00
|
|
|
restart: always
|
|
|
|
mem_limit: 128m
|
2017-09-15 03:08:35 +03:00
|
|
|
labels:
|
|
|
|
- triton.cns.services=copilot-consul
|
2017-05-30 21:04:51 +03:00
|
|
|
ports:
|
2017-08-03 00:56:53 +03:00
|
|
|
- 8500:8500
|
2017-09-17 19:12:25 +03:00
|
|
|
expose:
|
|
|
|
- 9090
|
2017-05-30 20:52:10 +03:00
|
|
|
|
2017-05-30 21:04:51 +03:00
|
|
|
#############################################################################
|
|
|
|
# PROMETHEUS
|
|
|
|
#
|
|
|
|
# Prometheus is an open source performance monitoring tool
|
|
|
|
# it is included here for demo purposes and is not required
|
|
|
|
#############################################################################
|
|
|
|
prometheus:
|
2017-09-15 03:08:35 +03:00
|
|
|
image: autopilotpattern/prometheus:1.7.1-r24
|
2017-05-30 21:04:51 +03:00
|
|
|
restart: always
|
2017-06-29 17:29:54 +03:00
|
|
|
mem_limit: 1g
|
2017-05-30 21:04:51 +03:00
|
|
|
ports:
|
2017-08-03 00:56:53 +03:00
|
|
|
- 9090:9090
|
2017-09-15 03:08:35 +03:00
|
|
|
labels:
|
|
|
|
# This label sets the CNS name, Triton's automatic DNS
|
|
|
|
# Learn more at https://docs.joyent.com/public-cloud/network/cns
|
|
|
|
- triton.cns.services=prometheus
|
|
|
|
# This label selects the proper Joyent resource package
|
|
|
|
# https://www.joyent.com/blog/optimizing-docker-on-triton#ram-cpu-and-disk-resources-for-your-containers
|
|
|
|
- com.joyent.package=g4-highcpu-1G
|
|
|
|
env_file:
|
|
|
|
- _env
|
2017-05-30 21:04:51 +03:00
|
|
|
environment:
|
|
|
|
- CONSUL_AGENT=1
|
2017-09-15 03:08:35 +03:00
|
|
|
|
|
|
|
|
2017-05-30 21:04:51 +03:00
|
|
|
#############################################################################
|
|
|
|
# FRONTEND
|
|
|
|
#############################################################################
|
2017-08-03 00:56:53 +03:00
|
|
|
frontend:
|
2017-09-16 00:36:31 +03:00
|
|
|
image: joyent/copilot-frontend:1.3.5
|
2017-06-29 17:29:54 +03:00
|
|
|
mem_limit: 512m
|
2017-09-15 03:08:35 +03:00
|
|
|
labels:
|
|
|
|
- triton.cns.services=copilot
|
2017-08-03 00:56:53 +03:00
|
|
|
env_file:
|
|
|
|
- _env
|
2017-06-29 17:29:54 +03:00
|
|
|
environment:
|
2017-08-03 00:56:53 +03:00
|
|
|
- PORT=443
|
2017-05-30 21:04:51 +03:00
|
|
|
ports:
|
2017-08-03 00:56:53 +03:00
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
2017-09-17 19:12:25 +03:00
|
|
|
expose:
|
|
|
|
- 9090
|
2017-09-15 03:08:35 +03:00
|
|
|
restart: always
|
2017-08-03 00:56:53 +03:00
|
|
|
|
2017-05-30 20:52:10 +03:00
|
|
|
|
2017-05-30 21:04:51 +03:00
|
|
|
#############################################################################
|
|
|
|
# BACKEND
|
|
|
|
#############################################################################
|
2017-08-03 00:56:53 +03:00
|
|
|
api:
|
2017-09-19 01:00:41 +03:00
|
|
|
image: joyent/copilot-api:1.8.16
|
2017-09-15 03:08:35 +03:00
|
|
|
mem_limit: 1g
|
|
|
|
expose:
|
|
|
|
- 3000
|
2017-09-17 19:12:25 +03:00
|
|
|
- 9090
|
2017-08-03 00:56:53 +03:00
|
|
|
env_file:
|
|
|
|
- _env
|
2017-05-30 21:04:51 +03:00
|
|
|
environment:
|
2017-06-29 17:29:54 +03:00
|
|
|
- PORT=3000
|
2017-09-15 03:08:35 +03:00
|
|
|
restart: always
|
2017-08-03 00:56:53 +03:00
|
|
|
|
|
|
|
# Docker-compose wrapper
|
|
|
|
# Create _env file from running ./setup.sh
|
|
|
|
compose-api:
|
2017-09-16 00:36:31 +03:00
|
|
|
image: joyent/copilot-compose:1.1.1
|
2017-08-03 00:56:53 +03:00
|
|
|
expose:
|
|
|
|
- 4242
|
2017-09-17 19:12:25 +03:00
|
|
|
- 9090
|
2017-08-03 00:56:53 +03:00
|
|
|
env_file:
|
|
|
|
- _env
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
rethinkdb:
|
2017-09-15 03:08:35 +03:00
|
|
|
image: autopilotpattern/rethinkdb:2.3.5r2
|
2017-08-03 00:56:53 +03:00
|
|
|
restart: always
|
|
|
|
mem_limit: 1g
|
2017-08-21 20:03:17 +03:00
|
|
|
env_file:
|
|
|
|
- _env
|
|
|
|
environment:
|
|
|
|
- CONSUL_AGENT=1
|
2017-08-03 00:56:53 +03:00
|
|
|
expose:
|
|
|
|
- 28015
|
|
|
|
- 29015
|
2017-09-17 19:12:25 +03:00
|
|
|
- 9090
|