Turns out I had to create a folder :/ remove the loop script and bugfix
This commit is contained in:
parent
558c542112
commit
a386ac668b
4 changed files with 7 additions and 6 deletions
2
Procfile
2
Procfile
|
@ -1,3 +1,3 @@
|
||||||
swarmmerge: /app/swarmloop.sh
|
swarmmerge: while true; do ls -d /etc/nginx/node.conf.d/*.conf | entr -d python3 /app/mergeswarm.py; done
|
||||||
dockergen: docker-gen -watch /app/nginx.tmpl /etc/nginx/node.conf.d/`hostname`.conf
|
dockergen: docker-gen -watch /app/nginx.tmpl /etc/nginx/node.conf.d/`hostname`.conf
|
||||||
nginx: nginx
|
nginx: nginx
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from crossplane import parse, build
|
from crossplane import parse, build
|
||||||
|
@ -8,6 +9,10 @@ SWARM_CONFIG_FILE = '/etc/nginx/node.conf.d/swarm.conf'
|
||||||
NGINX_OUTPUT = '/etc/nginx/conf.d/default.conf'
|
NGINX_OUTPUT = '/etc/nginx/conf.d/default.conf'
|
||||||
NGINX_RELOAD = 'nginx -s reload'
|
NGINX_RELOAD = 'nginx -s reload'
|
||||||
|
|
||||||
|
if not os.path.isfile(SWARM_CONFIG_FILE):
|
||||||
|
with open(SWARM_CONFIG_FILE, 'w') as f:
|
||||||
|
f.write("http { include ./*.conf; }")
|
||||||
|
|
||||||
nginx_config = []
|
nginx_config = []
|
||||||
swarm_config = parse(SWARM_CONFIG_FILE)['config']
|
swarm_config = parse(SWARM_CONFIG_FILE)['config']
|
||||||
nodes = [f['parsed'] for f in swarm_config[1:-1]]
|
nodes = [f['parsed'] for f in swarm_config[1:-1]]
|
||||||
|
|
|
@ -14,7 +14,7 @@ services:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
- /tmp/proxyconf:/var/nginx/node.conf.d/
|
- /tmp/proxyconf/:/etc/nginx/node.conf.d/
|
||||||
|
|
||||||
whoami1:
|
whoami1:
|
||||||
deploy:
|
deploy:
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
while true;
|
|
||||||
do
|
|
||||||
ls -d /etc/nginx/node.conf.d/*.conf | entr -d python3 /app/mergeswarm.py;
|
|
||||||
done
|
|
Loading…
Reference in a new issue