2017-06-19 17:37:38 +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-06-20 02:52:20 +03:00
|
|
|
image: autopilotpattern/consul:0.7.2-r0.8
|
2017-06-19 17:37:38 +03:00
|
|
|
command: >
|
|
|
|
/usr/local/bin/containerpilot
|
|
|
|
/bin/consul agent -server
|
2017-06-20 02:52:20 +03:00
|
|
|
-config-dir=/etc/consul
|
|
|
|
-log-level=err
|
|
|
|
-bootstrap-expect 1
|
|
|
|
-ui-dir /ui
|
2017-06-19 17:37:38 +03:00
|
|
|
restart: always
|
|
|
|
mem_limit: 128m
|
|
|
|
ports:
|
2017-06-20 02:52:20 +03:00
|
|
|
- 8500:8500
|
2017-06-19 17:37:38 +03:00
|
|
|
dns:
|
|
|
|
- 127.0.0.1
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# PROMETHEUS
|
|
|
|
#
|
|
|
|
# Prometheus is an open source performance monitoring tool
|
|
|
|
# it is included here for demo purposes and is not required
|
|
|
|
#############################################################################
|
|
|
|
prometheus:
|
2017-06-20 02:52:20 +03:00
|
|
|
image: autopilotpattern/prometheus:1.7.1-r20
|
2017-06-19 17:37:38 +03:00
|
|
|
restart: always
|
|
|
|
mem_limit: 1g
|
|
|
|
ports:
|
2017-06-20 02:52:20 +03:00
|
|
|
- 9090:9090
|
2017-06-19 17:37:38 +03:00
|
|
|
links:
|
|
|
|
- consul:consul
|
|
|
|
environment:
|
|
|
|
- CONSUL=consul
|
|
|
|
- CONSUL_AGENT=1
|
2017-06-20 02:52:20 +03:00
|
|
|
dns:
|
|
|
|
- 127.0.0.1
|
|
|
|
|
2017-06-21 21:51:28 +03:00
|
|
|
# Docker-compose wrapper
|
|
|
|
# Create _env file from running ./setup.sh
|
|
|
|
docker-compose-api:
|
|
|
|
build: ./docker-compose-api
|
|
|
|
links:
|
|
|
|
- consul:consul
|
|
|
|
expose:
|
|
|
|
- 4242
|
|
|
|
env_file:
|
|
|
|
- _env
|
|
|
|
environment:
|
|
|
|
- CONSUL=consul
|
|
|
|
restart: always
|
|
|
|
dns:
|
|
|
|
- 127.0.0.1
|
|
|
|
|
2017-06-20 02:52:20 +03:00
|
|
|
traefik:
|
|
|
|
image: d0cker/traefik
|
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "8080:8080"
|
|
|
|
links:
|
|
|
|
- consul:consul
|
|
|
|
environment:
|
|
|
|
- CONSUL=consul
|
|
|
|
restart: always
|
2017-06-19 17:37:38 +03:00
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# FRONTEND
|
|
|
|
#############################################################################
|
|
|
|
frontend:
|
2017-06-20 02:52:20 +03:00
|
|
|
build: ./
|
|
|
|
dockerfile: packages/cp-frontend/Dockerfile
|
2017-06-19 17:37:38 +03:00
|
|
|
mem_limit: 512m
|
|
|
|
links:
|
|
|
|
- consul:consul
|
|
|
|
environment:
|
|
|
|
- CONSUL=consul
|
2017-06-20 17:56:20 +03:00
|
|
|
- PORT=3069
|
2017-06-20 02:52:20 +03:00
|
|
|
- REACT_APP_GQL_HOSTNAME=localhost
|
|
|
|
- REACT_APP_GQL_PORT=80
|
|
|
|
expose:
|
2017-06-20 17:56:20 +03:00
|
|
|
- 3069
|
2017-06-19 17:37:38 +03:00
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# BACKEND
|
|
|
|
#############################################################################
|
|
|
|
api:
|
2017-06-20 02:52:20 +03:00
|
|
|
build: ./
|
|
|
|
dockerfile: packages/portal-api/Dockerfile
|
2017-06-19 17:37:38 +03:00
|
|
|
mem_limit: 512m
|
|
|
|
links:
|
|
|
|
- consul:consul
|
|
|
|
- rethinkdb:rethinkdb
|
2017-06-22 04:05:45 +03:00
|
|
|
env_file:
|
|
|
|
- _env
|
2017-06-19 17:37:38 +03:00
|
|
|
environment:
|
|
|
|
- CONSUL=consul
|
|
|
|
- PORT=3000
|
|
|
|
- RETHINK_HOST=rethinkdb
|
2017-06-22 20:09:13 +03:00
|
|
|
- DOCKER_HOST=$DOCKER_HOST
|
|
|
|
- DOCKER_CERT_PATH=$DOCKER_CERT_PATH
|
|
|
|
- DOCKER_CLIENT_TIMEOUT=$DOCKER_CLIENT_TIMEOUT
|
|
|
|
- SDC_URL=$SDC_URL
|
|
|
|
- SDC_ACCOUNT=$SDC_ACCOUNT
|
|
|
|
- SDC_KEY_ID=$SDC_KEY_ID
|
2017-06-20 02:52:20 +03:00
|
|
|
expose:
|
2017-06-19 17:37:38 +03:00
|
|
|
- 3000
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# DATABASE
|
|
|
|
#############################################################################
|
|
|
|
rethinkdb:
|
|
|
|
image: rethinkdb
|
|
|
|
restart: always
|
|
|
|
mem_limit: 1g
|
2017-06-21 21:51:28 +03:00
|
|
|
ports:
|
|
|
|
- 8081:8080
|
2017-06-19 17:37:38 +03:00
|
|
|
expose:
|
|
|
|
- 28015
|
|
|
|
- 29015
|