Turns out I had to create a folder :/ remove the loop script and bugfix

This commit is contained in:
Jonathan Adami 2020-04-26 18:04:58 +10:00
parent 558c542112
commit a386ac668b
4 changed files with 7 additions and 6 deletions

View file

@ -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
nginx: nginx

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
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_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 = []
swarm_config = parse(SWARM_CONFIG_FILE)['config']
nodes = [f['parsed'] for f in swarm_config[1:-1]]

View file

@ -14,7 +14,7 @@ services:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /tmp/proxyconf:/var/nginx/node.conf.d/
- /tmp/proxyconf/:/etc/nginx/node.conf.d/
whoami1:
deploy:

View file

@ -1,4 +0,0 @@
while true;
do
ls -d /etc/nginx/node.conf.d/*.conf | entr -d python3 /app/mergeswarm.py;
done