feat: support docker swarm deployments

This commit is contained in:
Rainer Killinger
2022-05-09 13:51:14 +02:00
parent ac144095bf
commit 4bb46d8a06
5 changed files with 204 additions and 17 deletions

View File

@@ -30,6 +30,7 @@ process.on('unhandledRejection', async error => {
let containerHashCache = '';
let configHashCache = '';
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
/**
* Reads the container information from the docker socket and updates the nginx config if necessary
@@ -51,6 +52,8 @@ async function updateNginxConfig() {
// if containers changed -> write config file, reload nginx
if (containerHash !== containerHashCache || configHash !== configHashCache) {
Logger.log('Generating new NGINX configuration');
Logger.log('Waiting for Docker network to settle...');
await delay(10_000);
// render nginx config file
const nginxConfig = render(