split config and services
This commit is contained in:
parent
01611a7ff7
commit
546c594109
|
@ -16,6 +16,14 @@
|
||||||
src: "conf/service/auth.json.j2"
|
src: "conf/service/auth.json.j2"
|
||||||
dest: "conf/service/auth.json"
|
dest: "conf/service/auth.json"
|
||||||
|
|
||||||
|
- name: Start config swarm
|
||||||
|
docker_stack:
|
||||||
|
name: 'cdn-{{ infrastructure }}'
|
||||||
|
state: present
|
||||||
|
compose:
|
||||||
|
- "swarm-config.yaml"
|
||||||
|
when: dry is not defined or not dry|bool
|
||||||
|
|
||||||
- name: Start swarm
|
- name: Start swarm
|
||||||
docker_stack:
|
docker_stack:
|
||||||
name: 'cdn-{{ infrastructure }}'
|
name: 'cdn-{{ infrastructure }}'
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
configs:
|
||||||
|
router_conf:
|
||||||
|
file: ./conf/router/default.conf
|
||||||
|
|
||||||
|
cdn_pep_conf:
|
||||||
|
file: ./conf/pep/default.conf
|
||||||
|
cdn_pep_baseconf:
|
||||||
|
file: ./conf/pep/nginx.conf
|
||||||
|
cdn_pep:
|
||||||
|
file: ./conf/pep/pep.js
|
||||||
|
cdn_pepconfig:
|
||||||
|
file: ./conf/pep/config.js
|
||||||
|
|
||||||
|
cdn_conf:
|
||||||
|
file: ./conf/service/d4s-cdn.json
|
||||||
|
cdn_auth_conf:
|
||||||
|
file: ./conf/service/auth.json
|
||||||
|
|
50
swarm.yaml
50
swarm.yaml
|
@ -5,7 +5,7 @@ services:
|
||||||
cdn-router-dev:
|
cdn-router-dev:
|
||||||
image: nginx:stable-alpine
|
image: nginx:stable-alpine
|
||||||
networks:
|
networks:
|
||||||
- cdn-network
|
- cdn-local_cdn-network
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -16,13 +16,13 @@ services:
|
||||||
delay: 10s
|
delay: 10s
|
||||||
window: 120s
|
window: 120s
|
||||||
configs:
|
configs:
|
||||||
- source: nginx_router_conf
|
- source: cdn-local_router_conf
|
||||||
target: /etc/nginx/templates/default.conf.template
|
target: /etc/nginx/templates/default.conf.template
|
||||||
|
|
||||||
cdn-pep:
|
cdn-pep:
|
||||||
image: nginx:stable-alpine
|
image: nginx:stable-alpine
|
||||||
networks:
|
networks:
|
||||||
- cdn-network
|
- cdn-local_cdn-network
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
@ -31,20 +31,20 @@ services:
|
||||||
delay: 10s
|
delay: 10s
|
||||||
window: 120s
|
window: 120s
|
||||||
configs:
|
configs:
|
||||||
- source: cdn_pep_conf
|
- source: cdn-local_cdn_pep_conf
|
||||||
target: /etc/nginx/templates/default.conf.template
|
target: /etc/nginx/templates/default.conf.template
|
||||||
- source: cdn_pep_baseconf
|
- source: cdn-local_cdn_pep_baseconf
|
||||||
target: /etc/nginx/nginx.conf
|
target: /etc/nginx/nginx.conf
|
||||||
- source: cdn_pep
|
- source: cdn-local_cdn_pep
|
||||||
target: /etc/nginx/pep.js
|
target: /etc/nginx/pep.js
|
||||||
- source: cdn_pepconfig
|
- source: cdn-local_cdn_pepconfig
|
||||||
target: /etc/nginx/config.js
|
target: /etc/nginx/config.js
|
||||||
|
|
||||||
|
|
||||||
d4s-cdn:
|
d4s-cdn:
|
||||||
image: nubisware/d4s-cdn
|
image: nubisware/d4s-cdn
|
||||||
networks:
|
networks:
|
||||||
- cdn-network
|
- cdn-local_cdn-network
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
@ -53,29 +53,29 @@ services:
|
||||||
delay: 10s
|
delay: 10s
|
||||||
window: 200s
|
window: 200s
|
||||||
configs:
|
configs:
|
||||||
- source: cdn_conf
|
- source: cdn-local_cdn_conf
|
||||||
target: /opt/app/cdn/conf/d4s-cdn.json
|
target: /opt/app/cdn/conf/d4s-cdn.json
|
||||||
- source: cdn_auth_conf
|
- source: cdn-local_cdn_auth_conf
|
||||||
target: /opt/app/cdn/conf/auth.json
|
target: /opt/app/cdn/conf/auth.json
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
cdn-network:
|
cdn-local_cdn-network:
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
nginx_router_conf:
|
cdn-local_router_conf:
|
||||||
file: ./conf/router/default.conf
|
external: true
|
||||||
|
|
||||||
cdn_pep_conf:
|
cdn-local_cdn_pep_conf:
|
||||||
file: ./conf/pep/default.conf
|
external: true
|
||||||
cdn_pep_baseconf:
|
cdn-local_cdn_pep_baseconf:
|
||||||
file: ./conf/pep/nginx.conf
|
external: true
|
||||||
cdn_pep:
|
cdn-local_cdn_pep:
|
||||||
file: ./conf/pep/pep.js
|
external: true
|
||||||
cdn_pepconfig:
|
cdn-local_cdn_pepconfig:
|
||||||
file: ./conf/pep/config.js
|
external: true
|
||||||
|
|
||||||
cdn_conf:
|
cdn-local_cdn_conf:
|
||||||
file: ./conf/service/d4s-cdn.json
|
external: true
|
||||||
cdn_auth_conf:
|
cdn-local_cdn_auth_conf:
|
||||||
file: ./conf/service/auth.json
|
external: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue