feat: triton docker deployment support

This commit is contained in:
geek 2017-08-07 13:32:32 -05:00 committed by Judit Greskovits
parent bfd54d481a
commit 7a1a890f1a
3 changed files with 10 additions and 14 deletions

View File

@ -17,8 +17,8 @@ RUN curl --retry 7 --fail -vo /tmp/consul.zip "https://releases.hashicorp.com/co
&& mkdir /config && mkdir /config
# Install ContainerPilot # Install ContainerPilot
ENV CP_SHA1 e27c1b9cd1023e622f77bb19914606dee3c9b22c ENV CP_SHA1 056d45f728e9b9c61793d6f994da291d5eebeabd
ENV CONTAINERPILOT_VERSION 3.3.1 ENV CONTAINERPILOT_VERSION 3.3.2
RUN curl -Lo /tmp/containerpilot.tar.gz "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/containerpilot-${CONTAINERPILOT_VERSION}.tar.gz" \ RUN curl -Lo /tmp/containerpilot.tar.gz "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/containerpilot-${CONTAINERPILOT_VERSION}.tar.gz" \
&& echo "${CP_SHA1} /tmp/containerpilot.tar.gz" | sha1sum -c \ && echo "${CP_SHA1} /tmp/containerpilot.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerpilot.tar.gz -C /bin \ && tar zxf /tmp/containerpilot.tar.gz -C /bin \

View File

@ -58,6 +58,7 @@ http {
location / { location / {
try_files $uri /index.html; try_files $uri /index.html;
} }
{{ if service "api" }}
location /api { location /api {
rewrite /api/(.*) /$1 break; rewrite /api/(.*) /$1 break;
proxy_pass http://api_hosts; proxy_pass http://api_hosts;
@ -65,7 +66,7 @@ http {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Client-Dn $ssl_client_s_dn; proxy_set_header X-Client-Dn $ssl_client_s_dn;
} }{{ end }}
} }
# Includes mapping of file name extensions to MIME types of responses # Includes mapping of file name extensions to MIME types of responses

View File

@ -20,8 +20,6 @@ consul:
- triton.cns.services=copilot-consul - triton.cns.services=copilot-consul
ports: ports:
- 8500:8500 - 8500:8500
dns:
- 127.0.0.1
############################################################################# #############################################################################
# PROMETHEUS # PROMETHEUS
@ -44,8 +42,8 @@ prometheus:
- com.joyent.package=g4-highcpu-1G - com.joyent.package=g4-highcpu-1G
environment: environment:
- CONSUL_AGENT=1 - CONSUL_AGENT=1
dns: env_file:
- 127.0.0.1 - _env
############################################################################# #############################################################################
@ -54,6 +52,8 @@ prometheus:
frontend: frontend:
image: joyent/copilot-frontend image: joyent/copilot-frontend
mem_limit: 512m mem_limit: 512m
labels:
- triton.cns.services=copilot
env_file: env_file:
- _env - _env
environment: environment:
@ -61,8 +61,6 @@ frontend:
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
dns:
- 127.0.0.1
############################################################################# #############################################################################
@ -70,7 +68,7 @@ frontend:
############################################################################# #############################################################################
api: api:
image: joyent/copilot-api image: joyent/copilot-api
mem_limit: 512m mem_limit: 1g
links: links:
- rethinkdb:rethinkdb - rethinkdb:rethinkdb
env_file: env_file:
@ -95,10 +93,7 @@ rethinkdb:
image: rethinkdb image: rethinkdb
restart: always restart: always
mem_limit: 1g mem_limit: 1g
labels:
- triton.cns.services=copilot-rethinkdb
ports:
- 8080:8080
expose: expose:
- 28015 - 28015
- 29015 - 29015
- 8080