-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6603acf
commit 067568a
Showing
6 changed files
with
208 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
# | ||
# See: https://docs.docker.com/compose/env-file/ | ||
# | ||
CONSUL=consul | ||
COMPOSE_PROJECT_NAME=synchro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
MAKEFLAGS += --warn-undefined-variables | ||
SHELL := /bin/bash | ||
.SHELLFLAGS := -eu -o pipefail | ||
.DEFAULT_GOAL := build | ||
|
||
# Build the docker images | ||
# | ||
build: | ||
build: build-nginx build-synchro build-stashbox build-redis | ||
|
||
build-nginx: | ||
docker build -t synchro/synchro_nginx_ap nginx | ||
|
||
build-synchro: | ||
docker build -t synchro/synchro_ap synchro | ||
|
||
build-stashbox: | ||
docker build -t synchro/stashbox_ap stashbox | ||
|
||
build-redis: | ||
docker build -t synchro/synchro_redis_ap redis | ||
|
||
triton.env: | ||
./setup.sh | ||
|
||
# Start the composition on Triton | ||
runtriton: triton.env | ||
$(eval include triton.env) | ||
$(eval export $(shell sed 's/=.*//' triton.env)) | ||
docker-compose -f triton-compose.yml up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Nginx as a load-balancing tier and reverse proxy, with caching and optional SSL termination | ||
nginx: | ||
image: synchro/synchro_nginx_ap:1.0.2 | ||
mem_limit: 128m | ||
command: > | ||
/bin/containerpilot | ||
-config file:///etc/containerpilot/containerpilot.json | ||
nginx -g "daemon off;" | ||
restart: always | ||
ports: | ||
- 80 | ||
- 443 | ||
expose: | ||
- 9090 | ||
|
||
# The Synchro microservice | ||
synchro: | ||
image: synchro/synchro_ap:1.5.14 | ||
mem_limit: 512m | ||
restart: always | ||
expose: | ||
- 80 | ||
- 9090 | ||
environment: | ||
- SYNCHRO_CONFIG_URL=stashbox/config/config.json | ||
- SYNCHRO__PORT=80 | ||
- SYNCHRO__SESSIONSTORE_PACKAGE=synchro-api | ||
- SYNCHRO__SESSIONSTORE_SERVICE=IoRedisSessionStore | ||
- SYNCHRO__SESSIONSTORE__sentinels=true | ||
- SYNCHRO__SESSIONSTORE__consulRetries=5 | ||
- SYNCHRO__SESSIONSTORE__consulDelayMs=5000 | ||
- SYNCHRO__LOG4JS_CONFIG__levels__synchro-ioredis-session=DEBUG | ||
|
||
# StashBox | ||
stashbox: | ||
image: synchro/stashbox_ap:1.1.3 | ||
mem_limit: 128m | ||
expose: | ||
- 80 | ||
|
||
# redis | ||
redis: | ||
image: synchro/synchro_redis_ap:1.0.0 | ||
mem_limit: 128m | ||
restart: always | ||
expose: | ||
- 6379 | ||
- 26379 | ||
|
||
# service discovery tier | ||
consul: | ||
image: progrium/consul:latest | ||
mem_limit: 128m | ||
command: -server -bootstrap -ui-dir /ui | ||
restart: always | ||
expose: | ||
- 8500 | ||
dns: | ||
- 127.0.0.1 | ||
|
||
# Prometheus is an open source performance monitoring tool | ||
# it is included here for demo purposes and is not required | ||
prometheus: | ||
image: autopilotpattern/prometheus:latest | ||
mem_limit: 1g | ||
restart: always | ||
ports: | ||
- 9090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,59 @@ | ||
# By default, the value of CONSUL will come from the .env file in this directory and will direct the | ||
# services below to use the single consul instance directly. If you want to scale consul you should | ||
# specify CONSUL_AGENT (with a truthy value) and you will also likely want to set the value of CONSUL | ||
# to an appropriate host (for example, when deploying on Joyent, you would want to set it to a host name | ||
# that Joyent CNS will resolve - see setup.sh in this directory). | ||
# docker-compose.yml - Run services on local host | ||
# | ||
|
||
# Nginx as a load-balancing tier and reverse proxy, with caching and optional SSL termination | ||
nginx: | ||
image: synchro/synchro_nginx_ap:1.0.2 | ||
mem_limit: 128m | ||
command: > | ||
/bin/containerpilot | ||
-config file:///etc/containerpilot/containerpilot.json | ||
nginx -g "daemon off;" | ||
restart: always | ||
links: | ||
- consul | ||
- stashbox | ||
extends: | ||
file: common-services.yml | ||
service: nginx | ||
ports: | ||
- 80 | ||
- 443 | ||
- 9090 | ||
labels: | ||
# Joyent: Setting the CNS service name (not needed unless running on Joyent and using CNS) | ||
- triton.cns.services=synchro | ||
- 8080:80 | ||
links: | ||
- consul | ||
- stashbox | ||
environment: | ||
- CONSUL=${CONSUL} | ||
- CONSUL_AGENT=${CONSUL_AGENT} | ||
- CONSUL=consul | ||
|
||
# The Synchro microservice | ||
synchro: | ||
image: synchro/synchro_ap:1.5.14 | ||
mem_limit: 512m | ||
restart: always | ||
extends: | ||
file: common-services.yml | ||
service: synchro | ||
links: | ||
- redis | ||
- consul | ||
- stashbox | ||
expose: | ||
- 80 | ||
ports: | ||
- 9090 | ||
- redis | ||
- consul | ||
- stashbox | ||
environment: | ||
- SYNCHRO_CONFIG_URL=stashbox/config/config.json | ||
- SYNCHRO__PORT=80 | ||
- SYNCHRO__SESSIONSTORE_PACKAGE=synchro-api | ||
- SYNCHRO__SESSIONSTORE_SERVICE=IoRedisSessionStore | ||
- SYNCHRO__SESSIONSTORE__sentinels=true | ||
- SYNCHRO__SESSIONSTORE__consulRetries=5 | ||
- SYNCHRO__SESSIONSTORE__consulDelayMs=5000 | ||
- SYNCHRO__LOG4JS_CONFIG__levels__synchro-ioredis-session=DEBUG | ||
- CONSUL=${CONSUL} | ||
- CONSUL_AGENT=${CONSUL_AGENT} | ||
- CONSUL=consul | ||
|
||
# StashBox | ||
stashbox: | ||
image: synchro/stashbox_ap:1.1.3 | ||
mem_limit: 128m | ||
expose: | ||
- 80 | ||
extends: | ||
file: common-services.yml | ||
service: stashbox | ||
|
||
# redis | ||
redis: | ||
image: synchro/synchro_redis_ap:1.0.0 | ||
mem_limit: 128m | ||
restart: always | ||
extends: | ||
file: common-services.yml | ||
service: redis | ||
links: | ||
- consul | ||
expose: | ||
- 6379 | ||
- 26379 | ||
labels: | ||
- triton.cns.services=redis | ||
- consul | ||
environment: | ||
- CONSUL=${CONSUL} | ||
- CONSUL_AGENT=${CONSUL_AGENT} | ||
|
||
# service discovery tier | ||
consul: | ||
image: progrium/consul:latest | ||
mem_limit: 128m | ||
command: -server -bootstrap -ui-dir /ui | ||
restart: always | ||
expose: | ||
- 8500 | ||
dns: | ||
- 127.0.0.1 | ||
labels: | ||
- triton.cns.services=consul | ||
- CONSUL=consul | ||
|
||
# Prometheus is an open source performance monitoring tool | ||
# it is included here for demo purposes and is not required | ||
# Prometheus performance monitoring | ||
prometheus: | ||
image: autopilotpattern/prometheus:latest | ||
mem_limit: 1g | ||
restart: always | ||
extends: | ||
file: common-services.yml | ||
service: prometheus | ||
links: | ||
- consul | ||
ports: | ||
- 9090 | ||
labels: | ||
- triton.cns.services=prometheus | ||
- consul | ||
environment: | ||
- CONSUL=${CONSUL} | ||
- CONSUL_AGENT=${CONSUL_AGENT} | ||
- CONSUL=consul | ||
|
||
# service discovery tier | ||
consul: | ||
extends: | ||
file: common-services.yml | ||
service: consul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# triton-compose.yml - Run services on Triton | ||
# | ||
|
||
# Nginx as a load-balancing tier and reverse proxy, with caching and optional SSL termination | ||
nginx: | ||
extends: | ||
file: common-services.yml | ||
service: nginx | ||
links: | ||
- consul | ||
- stashbox | ||
labels: | ||
- triton.cns.services=${COMPOSE_PROJECT_NAME} | ||
environment: | ||
- CONSUL_AGENT=1 | ||
- CONSUL=consul-${COMPOSE_PROJECT_NAME}.svc.${TRITON_ACCOUNT}.${TRITON_DC}.cns.joyent.com | ||
|
||
# The Synchro microservice | ||
synchro: | ||
extends: | ||
file: common-services.yml | ||
service: synchro | ||
links: | ||
- redis | ||
- consul | ||
- stashbox | ||
environment: | ||
- CONSUL_AGENT=1 | ||
- CONSUL=consul-${COMPOSE_PROJECT_NAME}.svc.${TRITON_ACCOUNT}.${TRITON_DC}.cns.joyent.com | ||
|
||
# StashBox | ||
stashbox: | ||
extends: | ||
file: common-services.yml | ||
service: stashbox | ||
|
||
# redis | ||
redis: | ||
extends: | ||
file: common-services.yml | ||
service: redis | ||
links: | ||
- consul | ||
environment: | ||
- CONSUL_AGENT=1 | ||
- CONSUL=consul-${COMPOSE_PROJECT_NAME}.svc.${TRITON_ACCOUNT}.${TRITON_DC}.cns.joyent.com | ||
|
||
# Prometheus performance monitoring | ||
prometheus: | ||
extends: | ||
file: common-services.yml | ||
service: prometheus | ||
links: | ||
- consul | ||
labels: | ||
- triton.cns.services=prometheus-${COMPOSE_PROJECT_NAME} | ||
environment: | ||
- CONSUL_AGENT=1 | ||
- CONSUL=consul-${COMPOSE_PROJECT_NAME}.svc.${TRITON_ACCOUNT}.${TRITON_DC}.cns.joyent.com | ||
|
||
# service discovery tier | ||
consul: | ||
extends: | ||
file: common-services.yml | ||
service: consul | ||
labels: | ||
- triton.cns.services=consul-${COMPOSE_PROJECT_NAME} |